﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

using H2.NET.Controls;
using H2.NET.Business;
using H2.NET.Data.Common;


namespace H2.NET.Web.Pages
{
    public partial class PTCMD : TaskPage
    {
        #region 属性 Public
        private bool IsLoaded
        {
            get
            {
                return ViewState["IsLoaded"] == null ? false : (bool)ViewState["IsLoaded"];
            }
            set { ViewState["IsLoaded"] = value; }
        }
        #endregion

        #region 事件 Page_Load(页面加载)
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                INFO.Text = string.Format("<br/>表单正在被同事“{0}”抢占处理，拒绝提交！", RobUser);
                INFO.Visible = IsOverFlow;

                bool flg = (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) ? true : false;
                //InitDropDownList();

                #region 发起步骤
                if (TaskAPI.IsInitiate)
                {
                    VD.Checked = true;
                }
                if ((TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit))
                {
                    InitDropDownList();
                    SetColor();
                }
                #endregion

                #region 审批环节
                if (!TaskAPI.IsInitiate)
                {
                    #region 加载数据并显示
                    TW_cmd_Customer_Deco cmd = (TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == TaskAPI.Incident).ListFirst<TW_cmd_Customer_Deco>();
                    if (cmd != null)
                    {
                        //SetColor();
                        ApplicationNo.Text = cmd.ApplicationNo;
                        Actions.SelectedValue = cmd.Actions;
                        DrpPriority.SelectedValue = cmd.DrpPriority;
                        DMO_DrpPriority.SelectedValue = cmd.DMO_DrpPriority;
                        SetColor();
                        VD.Checked = cmd.VD_Checked == "1";
                        SA.Checked = cmd.SA_Checked == "1";
                        SA2.Checked = cmd.SA2_Checked == "1";
                        SA3.Checked = cmd.SA3_Checked == "1";



                        #region Sold to
                        BA_Existed_Sold_To_Code.Text = cmd.BA_Existed_Sold_To_Code;
                        BA_BPCS_Code.Text = cmd.BA_BPCS_Code;
                        BA_Customer_Name_In_ZH.Text = cmd.BA_Customer_Name_In_ZH;
                        BA_Search_Term_1.Text = cmd.BA_Search_Term_1;
                        BA_Search_Term_2.Text = cmd.BA_Search_Term_2;
                        BA_Hierarchy_1.Text = cmd.BA_Hierarchy_1;
                        BA_Hierarchy_2.Text = cmd.BA_Hierarchy_2;
                        BA_Country.Text = cmd.BA_Country;
                        BA_Existed_Sold_To_Code_City.Text = cmd.BA_Existed_Sold_To_Code_City;
                        BA_Street4.Text = cmd.BA_Street4;
                        BA_Existed_Sold_To_Code_Address.Text = cmd.BA_Existed_Sold_To_Code_Address;
                        BA_Existed_Sold_To_Code_Contact_Preson.Text = cmd.BA_Existed_Sold_To_Code_Contact_Preson;
                        BA_Existed_Sold_To_Code_Tel.Text = cmd.BA_Existed_Sold_To_Code_Tel;
                        BA_Post_Code.Text = cmd.BA_Post_Code;
                        BA_Email.Text = cmd.BA_Email;
                        BA_Fax.Text = cmd.BA_Fax;
                        Internat_Name.Text = cmd.Internat_Name;
                        Internat_Seach_Term.Text = cmd.Internat_Seach_Term;
                        Internat_Language.Text = cmd.Internat_Language;
                        Internat_Address.Text = cmd.Internat_Address;
                        Internat_City.Text = cmd.Internat_City;
                        Internat_Tel.Text = cmd.Internat_Tel;
                        Internat_Mobile.Text = cmd.Internat_Mobile;
                        Internat_Mail.Text = cmd.Internat_Mail;
                        Internat_Fax.Text = cmd.Internat_Fax;
                        BA_Existed_Payer_To_Code.Text = cmd.BA_Existed_Payer_To_Code;
                        BA_Bill_Name1.Text = cmd.BA_Bill_Name1;
                        BA_Bill_Search_Term1.Text = cmd.BA_Bill_Search_Term1;
                        BA_Bill_Search_Term2.Text = cmd.BA_Bill_Search_Term2;
                        BA_Bill_City.Text = cmd.BA_Bill_City;
                        BA_Bill_County_Code.Text = cmd.BA_Bill_County_Code;
                        BA_Bill_Street4.Text = cmd.BA_Bill_Street4;
                        BA_Bill_Address.Text = cmd.BA_Bill_Address;
                        BA_Bill_Contact_Person.Text = cmd.BA_Bill_Contact_Person;
                        BA_Bill_Tel.Text = cmd.BA_Bill_Tel;
                        BA_Bill_Postal_Code.Text = cmd.BA_Bill_Postal_Code;
                        BA_Bill_Mail.Text = cmd.BA_Bill_Mail;
                        BA_Bill_Fax.Text = cmd.BA_Bill_Fax;
                        BA_Existed_Code.Text = cmd.BA_Existed_Code;
                        BA_Old_BPCS_Indirect.Text = cmd.BA_Old_BPCS_Indirect;
                        BA_Indirect_Name1.Text = cmd.BA_Indirect_Name1;
                        BA_Indirect_Name2.Text = cmd.BA_Indirect_Name2;
                        BA_Indirect_Search_Term1.Text = cmd.BA_Indirect_Search_Term1;
                        BA_Indirect_Search_Term2.Text = cmd.BA_Indirect_Search_Term2;
                        BA_Indirect_City.Text = cmd.BA_Indirect_City;
                        BA_Indirect_Street4.Text = cmd.BA_Indirect_Street4;
                        BA_Indirect_Address.Text = cmd.BA_Indirect_Address;
                        BA_Indirect_Person.Text = cmd.BA_Indirect_Person;
                        BA_Indirect_Tel.Text = cmd.BA_Indirect_Tel;
                        BA_Indirect_Postal_Code.Text = cmd.BA_Indirect_Postal_Code;
                        BA_Indirect_Mail.Text = cmd.BA_Indirect_Mail;
                        BA_Indirect_Fax.Text = cmd.BA_Indirect_Fax;
                        // BA_Bazaar_Code.Text = cmd.BA_Bazaar_Code;
                        BA_Indirect_Transportation_Zone.Text = cmd.BA_Indirect_Transportation_Zone;
                        BA_Transportation_Zone.Text = cmd.BA_Transportation_Zone;

                        BA_Industry_Code2.Text = cmd.BA_Industry_Code2;
                        BA_County_Code.Text = cmd.BA_County_Code;
                        BA_Tax_Number2.Text = cmd.BA_Tax_Number2;
                        BA_Bank_Key.Text = cmd.BA_Bank_Key;
                        BA_Bank_Name.Text = cmd.BA_Bank_Name;
                        BA_Account.Text = cmd.BA_Account;
                        BA_Acct_Holder.Text = cmd.BA_Acct_Holder;
                        CO_Company.Text = cmd.CO_Company;
                        CO_Dunn_Procedure.Text = cmd.CO_Dunn_Procedure;
                        CO_Sort_Key.Text = cmd.CO_Sort_Key;
                        CO_BPCS.Text = cmd.CO_BPCS;
                        CO_Cash_Mgmt.Text = cmd.CO_Cash_Mgmt;
                        SA_Max_Partial_Deliveries_1.Text = cmd.SA_Max_Partial_Deliveries_1;
                        CO_Bank_Statement.Text = cmd.CO_Bank_Statement;
                        SA_Sales_Org.Text = cmd.SA_Sales_Org;
                        SA_Currency.Text = cmd.SA_Currency;
                        SA_Order_Combination.Text = cmd.SA_Order_Combination;
                        SA_Partial_Delivery_Per_Item.Text = cmd.SA_Partial_Delivery_Per_Item;
                        SA_Tax_Classification.Text = cmd.SA_Tax_Classification;
                        SA_Itcoterms2.Text = cmd.SA_Itcoterms2;
                        SA_Departing_Country.Text = cmd.SA_Departing_Country;
                        SA_Customer_Group_3.Text = cmd.SA_Customer_Group_3;
                        SA_Partner_Function.Text = cmd.SA_Partner_Function;
                        SA_Partner_Number.Text = cmd.SA_Partner_Number;
                        SA_Customer_Description.Text = cmd.SA_Customer_Description;
                        SA_Sales_Code.Text = cmd.SA_Sales_Code;
                        Text_Internal.Text = cmd.Text_Internal;
                        Text_Shipping.Text = cmd.Text_Shipping;
                        Text_Pay.Text = cmd.Text_Pay;
                        Text_External.Text = cmd.Text_External;
                        Attributes8.Text = cmd.Attributes8;
                        Attributes9.Text = cmd.Attributes9;
                        SA_Terms_Of_Payment.Text = cmd.SA_Terms_Of_Payment;
                        SA_Distribution_Channel.Text = cmd.SA_Distribution_Channel;
                        BA_Industry_Code3.Text = cmd.BA_Industry_Code3;
                        SA_Delivering_Plant.Text = cmd.SA_Delivering_Plant;
                        BA_Cust_Pric.Text = cmd.BA_Cust_Pric;


                        SetDropDownListValue(BA_Sales_Employee, cmd.BA_Sales_Employee);
                        SetDropDownListValue(BA_Account_Group, cmd.BA_Account_Group);
                        SetDropDownListValue(BA_Region, cmd.BA_Region);
                        SetDropDownListValue(BA_Language, cmd.BA_Language);
                        SetDropDownListValue(BA_Default_BillTo, cmd.BA_Default_BillTo);
                        SetDropDownListValue(BA_Bill_City_Code, cmd.BA_Bill_City_Code);
                        SetDropDownListValue(BA_Default_Indirect, cmd.BA_Default_Indirect);
                        SetDropDownListValue(BA_Industry, cmd.BA_Industry);
                        SetDropDownListValue(BA_Bank_Country, cmd.BA_Bank_Country);
                        SetDropDownListValue(CO_Recon_Account, cmd.CO_Recon_Account);
                        SetDropDownListValue(CO_Payment_Terms, cmd.CO_Payment_Terms);
                        SetDropDownListValue(CO_Payment_Methods, cmd.CO_Payment_Methods);
                        SetDropDownListValue(SA_Sales_Office, cmd.SA_Sales_Office);
                        SetDropDownListValue(SA_Price_Group_1, cmd.SA_Price_Group_1);
                        SetDropDownListValue(SA_Price_Group_2, cmd.SA_Price_Group_2);
                        SetDropDownListValue(SA_Delivery_Priority, cmd.SA_Delivery_Priority);
                        SetDropDownListValue(SA_Shipping_Condition, cmd.SA_Shipping_Condition);
                        //SetDropDownListValue(BA_Cust_Pric, cmd.BA_Cust_Pric);
                        SetDropDownListValue(SA_Acct_Assgmt_Group, cmd.SA_Acct_Assgmt_Group);
                        SetDropDownListValue(SA_Itcoterms, cmd.SA_Itcoterms);
                        SetDropDownListValue(Attributes1, cmd.Attributes1);
                        SetDropDownListValue(Attributes2, cmd.Attributes2);
                        SetDropDownListValue(Attributes3, cmd.Attributes3);
                        SetDropDownListValue(Attributes4, cmd.Attributes4);
                        SetDropDownListValue(Attributes5, cmd.Attributes5); ;
                        SetDropDownListValue(BA_City_Code, cmd.BA_City_Code);
                        SetDropDownListValue(BA_APO_Group, cmd.BA_APO_Group);
                        SetDropDownListValue(Sales_District, cmd.Sales_District);
                        SetDropDownListValue(Attributes7, cmd.Attributes7);
                        SetDropDownListValue(BA_Industry1, cmd.BA_Industry1);
                        SetDropDownListValue(BA_Instruction_Key, cmd.BA_Instruction_Key);

                        SA_Customer_Division_K1.Checked = cmd.SA_Customer_Division_K1 == "1";
                        SA_Customer_Division_K2.Checked = cmd.SA_Customer_Division_K2 == "1";
                        SA_Customer_Division_K3.Checked = cmd.SA_Customer_Division_K3 == "1";
                        SA_Customer_Division_K6.Checked = cmd.SA_Customer_Division_K6 == "1";
                        SA_Customer_Division_10.Checked = cmd.SA_Customer_Division_10 == "1";
                        SA_Customer_Division_K7.Checked = cmd.SA_Customer_Division_K7 == "1";
                        SA_Customer_Division_K8.Checked = cmd.SA_Customer_Division_K8 == "1";
                        SA_Switch_Off_Rounding.Checked = cmd.SA_Switch_Off_Rounding == "1";
                        SA_Relevant_For_POD.Checked = cmd.SA_Relevant_For_POD == "1";
                        SA_Rebate.Checked = cmd.SA_Rebate == "1";
                        SA_Price_Determin.Checked = cmd.SA_Price_Determin == "1";
                        SA_Complete_Delivery_Reqd_By_Law.Checked = cmd.SA_Complete_Delivery_Reqd_By_Law == "1";
                        CO_Payment_History_Record.Checked = cmd.CO_Payment_History_Record == "1";
                        #endregion


                        #region Ship to
                        ST_Sold_To_No.Text = cmd.ST_Sold_To_No;
                        ST_Old_Ship_BPCS.Text = cmd.ST_Old_Ship_BPCS;
                        ST_Sold_To_Name.Text = cmd.ST_Sold_To_Name;
                        ST_Search_Term1.Text = cmd.ST_Search_Term1;
                        ST_Search_Term2.Text = cmd.ST_Search_Term2;
                        ST_Ship_To_No.Text = cmd.ST_Ship_To_No;
                        ST_Ship_To_Name.Text = cmd.ST_Ship_To_Name;
                        ST_Country.Text = cmd.ST_Country;
                        ST_City.Text = cmd.ST_City;
                        ST_Street4.Text = cmd.ST_Street4;
                        ST_Address.Text = cmd.ST_Address;
                        ST_Contact_Person.Text = cmd.ST_Contact_Person;
                        ST_Tel.Text = cmd.ST_Tel;
                        ST_Postal_Code.Text = cmd.ST_Postal_Code;
                        ST_Mail.Text = cmd.ST_Mail;
                        ST_Fax.Text = cmd.ST_Fax;
                        ST_Transportation_Zone.Text = cmd.ST_Transportation_Zone;
                        ST_County_Code.Text = cmd.ST_County_Code;
                        ST_Sales_Org.Text = cmd.ST_Sales_Org;
                        ST_Currency.Text = cmd.ST_Currency;
                        ST_Delivering_Plant.Text = cmd.ST_Delivering_Plant;
                        ST_Tax_Classification.Text = cmd.ST_Tax_Classification;
                        ST_Itcoterms2.Text = cmd.ST_Itcoterms2;
                        ST_Cus_Grp3.Text = cmd.ST_Cus_Grp3;
                        ST_Partial_Delivery_Per_Item.Text = cmd.ST_Partial_Delivery_Per_Item;
                        ST_Max_Partial_Deliveries.Text = cmd.ST_Max_Partial_Deliveries;
                        ST_Depart_Country.Text = cmd.ST_Depart_Country;
                        ST_Attributes9.Text = cmd.ST_Attributes9;
                        ST_Distribution.Text = cmd.ST_Distribution;
                        ST_Cust_Pric.Text = cmd.ST_Cust_Pric;

                        SetDropDownListValue(ST_Default_Ship, cmd.ST_Default_Ship);
                        SetDropDownListValue(ST_DEL_ST_Address, cmd.ST_DEL_ST_Address);
                        SetDropDownListValue(ST_Region, cmd.ST_Region);
                        SetDropDownListValue(ST_Language, cmd.ST_Language);
                        SetDropDownListValue(ST_Industry, cmd.ST_Industry);
                        SetDropDownListValue(ST_Industry_Code1, cmd.ST_Industry_Code1);
                        SetDropDownListValue(ST_City_Code, cmd.ST_City_Code);
                        SetDropDownListValue(ST_Sales_District, cmd.ST_Sales_District);
                        SetDropDownListValue(ST_Sales_Office, cmd.ST_Sales_Office);
                        SetDropDownListValue(ST_Delivery_Priority, cmd.ST_Delivery_Priority);
                        SetDropDownListValue(ST_Shipping_Condition, cmd.ST_Shipping_Condition);
                        SetDropDownListValue(ST_Acct_Assgmt_Group, cmd.ST_Acct_Assgmt_Group);
                        SetDropDownListValue(ST_Itcoterms, cmd.ST_Itcoterms);
                        SetDropDownListValue(ST_Attributes1, cmd.ST_Attributes1);
                        SetDropDownListValue(ST_Attributes2, cmd.ST_Attributes2);
                        SetDropDownListValue(ST_Attributes3, cmd.ST_Attributes3);
                        SetDropDownListValue(ST_Attributes4, cmd.ST_Attributes4);
                        SetDropDownListValue(ST_Price_Group_1, cmd.ST_Price_Group_1);
                        SetDropDownListValue(ST_Price_Group_2, cmd.ST_Price_Group_2);


                        ST_Customer_Division_K1.Checked = cmd.ST_Customer_Division_K1 == "1";
                        ST_Customer_Division_K2.Checked = cmd.ST_Customer_Division_K2 == "1";
                        ST_Customer_Division_K3.Checked = cmd.ST_Customer_Division_K3 == "1";
                        ST_Customer_Division_K6.Checked = cmd.ST_Customer_Division_K6 == "1";
                        ST_Customer_Division_10.Checked = cmd.ST_Customer_Division_10 == "1";
                        ST_Customer_Division_K7.Checked = cmd.ST_Customer_Division_K7 == "1";
                        ST_Customer_Division_K8.Checked = cmd.ST_Customer_Division_K8 == "1";
                        ST_Switch_Off_Rounding.Checked = cmd.ST_Switch_Off_Rounding == "1";
                        ST_Relevant_For_POD.Checked = cmd.ST_Relevant_For_POD == "1";
                        ST_Rebate.Checked = cmd.ST_Rebate == "1";
                        ST_Price_Determin.Checked = cmd.ST_Price_Determin == "1";
                        ST_Order_Combination.Checked = cmd.ST_Order_Combination == "1";
                        ST_Complete_Delivery_Reqd_By_Law.Checked = cmd.ST_Complete_Delivery_Reqd_By_Law == "1";
                        #endregion


                        #region Rebeat
                        RE_BA_Existed_Sold_To_Code.Text = cmd.RE_BA_Existed_Sold_To_Code;
                        RE_BA_Account_Group.Text = cmd.RE_BA_Account_Group;
                        RE_BA_BPCS_Code.Text = cmd.RE_BA_BPCS_Code;
                        RE_BA_Customer_Name_In_ZH.Text = cmd.RE_BA_Customer_Name_In_ZH;
                        RE_BA_Search_Term_1.Text = cmd.RE_BA_Search_Term_1;
                        RE_BA_Search_Term_2.Text = cmd.RE_BA_Search_Term_2;
                        RE_BA_Hierarchy_1.Text = cmd.RE_BA_Hierarchy_1;
                        RE_BA_Hierarchy_2.Text = cmd.RE_BA_Hierarchy_2;
                        RE_BA_Country.Text = cmd.RE_BA_Country;
                        RE_BA_Existed_Sold_To_Code_City.Text = cmd.RE_BA_Existed_Sold_To_Code_City;
                        RE_BA_SoldTo_Code.Text = cmd.RE_BA_SoldTo_Code;
                        RE_BA_Street4.Text = cmd.RE_BA_Street4;
                        RE_BA_Existed_Sold_To_Code_Address.Text = cmd.RE_BA_Existed_Sold_To_Code_Address;
                        RE_BA_Existed_Sold_To_Code_Contact_Preson.Text = cmd.RE_BA_Existed_Sold_To_Code_Contact_Preson;
                        RE_BA_Existed_Sold_To_Code_Tel.Text = cmd.RE_BA_Existed_Sold_To_Code_Tel;
                        RE_BA_Post_Code.Text = cmd.RE_BA_Post_Code;
                        RE_BA_Email.Text = cmd.RE_BA_Email;
                        RE_BA_Fax.Text = cmd.RE_BA_Fax;
                        RE_BA_Transportation_Zone.Text = cmd.RE_BA_Transportation_Zone;
                        RE_BA_County_Code.Text = cmd.RE_BA_County_Code;
                        RE_BA_Tax_Number2.Text = cmd.RE_BA_Tax_Number2;
                        RE_BA_Bank_Key.Text = cmd.RE_BA_Bank_Key;
                        RE_BA_Bank_Name.Text = cmd.RE_BA_Bank_Name;
                        RE_CO_Dunn_Procedure.Text = cmd.RE_CO_Dunn_Procedure;
                        RE_BA_Industry_Code2.Text = cmd.RE_BA_Industry_Code2;
                        RE_BA_Cust_Pric.Text = cmd.RE_BA_Cust_Pric;


                        RE_BA_Account.Text = cmd.RE_BA_Account;
                        RE_BA_Acct_Holder.Text = cmd.RE_BA_Acct_Holder;
                        RE_CO_Company.Text = cmd.RE_CO_Company;
                        RE_CO_Sort_Key.Text = cmd.RE_CO_Sort_Key;
                        RE_CO_BPCS.Text = cmd.RE_CO_BPCS;
                        RE_CO_Cash_Mgmt.Text = cmd.RE_CO_Cash_Mgmt;
                        RE_CO_Bank_Statement.Text = cmd.RE_CO_Bank_Statement;
                        RE_SA_Sales_Org.Text = cmd.RE_SA_Sales_Org;
                        RE_SA_Currency.Text = cmd.RE_SA_Currency;
                        RE_SA_Partial_Delivery_Per_Item.Text = cmd.RE_SA_Partial_Delivery_Per_Item;
                        RE_SA_Max_Partial_Deliveries_1.Text = cmd.RE_SA_Max_Partial_Deliveries_1;
                        RE_SA_Order_Combination.Text = cmd.RE_SA_Order_Combination;
                        RE_SA_Tax_Classification.Text = cmd.RE_SA_Tax_Classification;
                        RE_SA_Itcoterms2.Text = cmd.RE_SA_Itcoterms2;
                        RE_SA_Departing_Country.Text = cmd.RE_SA_Departing_Country;
                        RE_SA_Terms_Of_Payment.Text = cmd.RE_SA_Terms_Of_Payment;
                        RE_SA_Customer_Group_3.Text = cmd.RE_SA_Customer_Group_3;
                        RE_SA_Partner_Function.Text = cmd.RE_SA_Partner_Function;
                        RE_SA_Partner_Number.Text = cmd.RE_SA_Partner_Number;
                        RE_SA_Customer_Description.Text = cmd.RE_SA_Customer_Description;
                        RE_SA_Sales_Code.Text = cmd.RE_SA_Sales_Code;
                        RE_Text_Internal.Text = cmd.RE_Text_Internal;
                        RE_Text_Shipping.Text = cmd.RE_Text_Shipping;
                        RE_Text_Pay.Text = cmd.RE_Text_Pay;
                        RE_Text_External.Text = cmd.RE_Text_External;
                        RE_BA_Industry_Code3.Text = cmd.RE_BA_Industry_Code3;
                        //RE_Sales_District.SelectedValue = cmd.RE_Sales_District;
                        RE_Attributes7.SelectedValue = cmd.RE_Attributes7;
                        RE_Attributes8.Text = cmd.RE_Attributes8;
                        RE_Attributes9.Text = cmd.RE_Attributes9;
                        RE_SA_Distribution_Channel.Text = cmd.RE_SA_Distribution_Channel;
                        RE_SA_Delivering_Plant.Text = cmd.RE_SA_Delivering_Plant;

                        SetDropDownListValue(RE_BA_Sales_Employee, cmd.RE_BA_Sales_Employee);
                        SetDropDownListValue(RE_BA_Region, cmd.RE_BA_Region);
                        SetDropDownListValue(RE_BA_Language, cmd.RE_BA_Language);
                        SetDropDownListValue(RE_BA_Industry, cmd.RE_BA_Industry);
                        SetDropDownListValue(RE_BA_Industry1, cmd.RE_BA_Industry1);
                        SetDropDownListValue(RE_BA_Instruction_Key, cmd.RE_BA_Instruction_Key);
                        SetDropDownListValue(RE_BA_APO_Group, cmd.RE_BA_APO_Group);
                        SetDropDownListValue(RE_BA_City_Code, cmd.RE_BA_City_Code);
                        SetDropDownListValue(RE_BA_Bank_Country, cmd.RE_BA_Bank_Country);
                        SetDropDownListValue(RE_CO_Recon_Account, cmd.RE_CO_Recon_Account);
                        SetDropDownListValue(RE_CO_Payment_Terms, cmd.RE_CO_Payment_Terms);
                        SetDropDownListValue(RE_CO_Payment_Methods, cmd.RE_CO_Payment_Methods);
                        SetDropDownListValue(RE_SA_Sales_Office, cmd.RE_SA_Sales_Office);
                        SetDropDownListValue(RE_SA_Price_Group_1, cmd.RE_SA_Price_Group_1);
                        SetDropDownListValue(RE_SA_Price_Group_2, cmd.RE_SA_Price_Group_2);
                        SetDropDownListValue(RE_SA_Delivery_Priority, cmd.RE_SA_Delivery_Priority);
                        SetDropDownListValue(RE_SA_Shipping_Condition, cmd.RE_SA_Shipping_Condition);
                        //SetDropDownListValue(RE_BA_Cust_Pric, cmd.RE_BA_Cust_Pric);
                        SetDropDownListValue(RE_SA_Acct_Assgmt_Group, cmd.RE_SA_Acct_Assgmt_Group);
                        SetDropDownListValue(RE_SA_Itcoterms, cmd.RE_SA_Itcoterms);
                        SetDropDownListValue(RE_Attributes1, cmd.RE_Attributes1);
                        SetDropDownListValue(RE_Attributes2, cmd.RE_Attributes2);
                        SetDropDownListValue(RE_Attributes3, cmd.RE_Attributes3);
                        SetDropDownListValue(RE_Attributes4, cmd.RE_Attributes4);
                        SetDropDownListValue(RE_Attributes5, cmd.RE_Attributes5);
                        SetDropDownListValue(RE_Sales_District, cmd.RE_Sales_District);
                        SetDropDownListValue(RE_Attributes7, cmd.RE_Attributes7);

                        RE_SA_Customer_Division_K1.Checked = cmd.RE_SA_Customer_Division_K1 == "1";
                        RE_SA_Customer_Division_K2.Checked = cmd.RE_SA_Customer_Division_K2 == "1";
                        RE_SA_Customer_Division_K3.Checked = cmd.RE_SA_Customer_Division_K3 == "1";
                        RE_SA_Customer_Division_K6.Checked = cmd.RE_SA_Customer_Division_K6 == "1";
                        RE_SA_Customer_Division_10.Checked = cmd.RE_SA_Customer_Division_10 == "1";
                        RE_SA_Customer_Division_K7.Checked = cmd.RE_SA_Customer_Division_K7 == "1";
                        RE_SA_Customer_Division_K8.Checked = cmd.RE_SA_Customer_Division_K8 == "1";
                        RE_SA_Switch_Off_Rounding.Checked = cmd.RE_SA_Switch_Off_Rounding == "1";
                        RE_SA_Relevant_For_POD.Checked = cmd.RE_SA_Relevant_For_POD == "1";
                        RE_SA_Rebate.Checked = cmd.RE_SA_Rebate == "1";
                        RE_SA_Price_Determin.Checked = cmd.RE_SA_Price_Determin == "1";
                        RE_SA_Complete_Delivery_Reqd_By_Law.Checked = cmd.RE_SA_Complete_Delivery_Reqd_By_Law == "1";
                        RE_CO_Payment_History_Record.Checked = cmd.RE_CO_Payment_History_Record == "1"; ;

                        #endregion


                        #region Hierarchy
                        NA_Existed_Code.Text = cmd.NA_Existed_Code;
                        NA_Customer_Name.Text = cmd.NA_Customer_Name;
                        NA_City.Text = cmd.NA_City;
                        NA_Street.Text = cmd.NA_Street;
                        NA_Post_Code.Text = cmd.NA_Post_Code;
                        NA_Fax_No.Text = cmd.NA_Fax_No;
                        NA_Contact_Preson.Text = cmd.NA_Contact_Preson;
                        NA_Tel.Text = cmd.NA_Tel;

                        SetDropDownListValue(NA_Is_Have_Account, cmd.NA_Is_Have_Account);
                        SetDropDownListValue(NA_Region, cmd.NA_Region);
                        SetDropDownListValue(NA_Language, cmd.NA_Language);

                        NA_Customer_Division_K1.Checked = cmd.NA_Customer_Division_K1 == "1";
                        NA_Customer_Division_K2.Checked = cmd.NA_Customer_Division_K2 == "1";
                        NA_Customer_Division_K3.Checked = cmd.NA_Customer_Division_K3 == "1";
                        NA_Customer_Division_K6.Checked = cmd.NA_Customer_Division_K6 == "1";
                        NA_Customer_Division_10.Checked = cmd.NA_Customer_Division_10 == "1";
                        NA_Customer_Division_K7.Checked = cmd.NA_Customer_Division_K7 == "1";
                        NA_Customer_Division_K8.Checked = cmd.NA_Customer_Division_K8 == "1";
                        NA_Rebate.Checked = cmd.NA_Rebate == "1";
                        NA_Price.Checked = cmd.NA_Price == "1";

                        #endregion



                    }
                    #endregion

                    #region 审批项初始化
                    switch (TaskAPI.Step)
                    {
                        case "Manager Approve":
                        case "Accounting Manager":
                        case "Finance Manager":
                            Assessment1.Option.Add(new t_AssessmentOption("Approve", "1", true));
                            Assessment1.Option.Add(new t_AssessmentOption("Return", "2", false));
                            break;
                        case "DMO Approve":
                        case "DMO Maintain":
                        case "DMO Check":
                        case "Applicator Confirm":
                            Assessment1.Option.Add(new t_AssessmentOption("Finish", "1", true));
                            Assessment1.Option.Add(new t_AssessmentOption("Return", "2", false));
                            break;

                    }
                    #endregion
                }
                #endregion

                SetDefaultValue();

                #region 设置控件禁启用
                //bool flg = (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) ? true : false;

                SetEnable(flg, VD, SA, SA2, SA3, Actions, DrpPriority, BA_Existed_Sold_To_Code, SA_Currency, BA_Country, RE_BA_Country, SA_Customer_Division_K6, SA_Customer_Division_10, SA_Customer_Division_K8, SA_Customer_Division_K7, RE_SA_Customer_Division_K6, RE_SA_Customer_Division_10, RE_SA_Customer_Division_K8, RE_SA_Customer_Division_K7, ST_Customer_Division_K1, ST_Customer_Division_K2, ST_Customer_Division_K3, NA_Customer_Division_K3, ST_Customer_Division_K6, ST_Customer_Division_10, ST_Customer_Division_K8, ST_Customer_Division_K7, ST_Currency, ST_Transportation_Zone, RE_SA_Currency, BA_Bill_Search_Term2, Text_External, BA_Account_Group, ST_Itcoterms2, BA_BPCS_Code, SA_Itcoterms2, SA_Departing_Country, RE_SA_Departing_Country, RE_SA_Itcoterms2, NA_Customer_Division_K6, NA_Customer_Division_10, NA_Customer_Division_K8, NA_Customer_Division_K7, BA_Customer_Name_In_ZH, BA_Hierarchy_1, BA_Hierarchy_2, BA_Existed_Sold_To_Code_City, BA_Street4, BA_Existed_Sold_To_Code_Address, BA_Existed_Sold_To_Code_Contact_Preson, BA_Existed_Sold_To_Code_Tel, BA_Post_Code, BA_Email, BA_Fax, Internat_Name, Internat_Language, Internat_Address, Internat_City, Internat_Tel, Internat_Mobile, Internat_Mail, Internat_Fax, BA_Existed_Payer_To_Code, BA_Bill_Name1, BA_Bill_City, BA_Bill_Street4, BA_Bill_Address, BA_Bill_Contact_Person, BA_Bill_Tel, BA_Bill_Postal_Code, BA_Bill_Mail, BA_Bill_Fax, BA_Existed_Code, BA_Old_BPCS_Indirect, BA_Indirect_Name1, BA_Indirect_Name2, BA_Indirect_City, BA_Indirect_Street4, BA_Indirect_Address, BA_Indirect_Person, BA_Indirect_Tel, BA_Indirect_Postal_Code, BA_Indirect_Mail, BA_Indirect_Fax, BA_Indirect_Transportation_Zone, BA_APO_Group, BA_Transportation_Zone, BA_Instruction_Key, BA_Industry1, BA_Industry_Code2, BA_Industry_Code3, BA_City_Code, BA_Tax_Number2, BA_Bank_Key, BA_Bank_Name, BA_Account, SA_Partner_Function, SA_Partner_Number, SA_Customer_Description, Text_Internal, Text_Shipping, SA_Customer_Group_3, RE_SA_Customer_Group_3, Text_Pay, Sales_District, Attributes7, Attributes8, BA_Sales_Employee, BA_Region, BA_Language, BA_Default_BillTo, BA_Bill_City_Code, BA_Default_Indirect, BA_Industry, BA_Bank_Country, CO_Recon_Account, CO_Payment_Terms, CO_Payment_Methods, SA_Sales_Office, SA_Price_Group_1, SA_Price_Group_2, SA_Delivery_Priority, SA_Shipping_Condition, SA_Acct_Assgmt_Group, SA_Itcoterms, Attributes1, Attributes2, Attributes3, Attributes4, Attributes5, SA_Customer_Division_K1, SA_Customer_Division_K2, SA_Customer_Division_K3, ST_Sold_To_No, ST_Old_Ship_BPCS, ST_Sold_To_Name, ST_Ship_To_No, ST_Ship_To_Name, ST_City, ST_Street4, ST_Address, ST_Contact_Person, ST_Tel, ST_Postal_Code, ST_Mail, ST_Fax, ST_Price_Group_1, ST_Price_Group_2, ST_Default_Ship, ST_DEL_ST_Address, ST_Region, ST_Language, ST_Industry, ST_Industry_Code1, ST_City_Code, ST_Sales_Office, ST_Delivery_Priority, ST_Shipping_Condition, ST_Acct_Assgmt_Group, ST_Itcoterms, ST_Attributes1, ST_Attributes2, ST_Attributes3, ST_Attributes4, SA_Customer_Division_K1, SA_Customer_Division_K2, SA_Customer_Division_K3, RE_BA_Existed_Sold_To_Code, RE_BA_BPCS_Code, RE_BA_Customer_Name_In_ZH, RE_BA_Hierarchy_1, RE_BA_Hierarchy_2, RE_BA_SoldTo_Code, RE_BA_Existed_Sold_To_Code_City, RE_BA_Street4, RE_BA_Existed_Sold_To_Code_Address, RE_BA_Existed_Sold_To_Code_Contact_Preson, RE_BA_Existed_Sold_To_Code_Tel, RE_BA_Post_Code, RE_BA_Email, RE_BA_Fax, RE_BA_Transportation_Zone, RE_BA_Industry_Code3, RE_BA_Tax_Number2, RE_BA_Bank_Key, RE_BA_Bank_Name, RE_BA_Account, RE_SA_Partner_Function, RE_SA_Partner_Number, RE_SA_Customer_Description, RE_Text_Internal, RE_Text_Shipping, RE_Text_Pay, RE_Text_External, ST_Sales_District, RE_Sales_District, RE_Attributes7, RE_Attributes8, RE_BA_Sales_Employee, RE_BA_Region, RE_BA_Language, RE_BA_Industry, RE_BA_APO_Group, RE_BA_Instruction_Key, RE_BA_Industry1, RE_BA_Industry_Code2, RE_BA_City_Code, RE_BA_Bank_Country, RE_CO_Recon_Account, RE_CO_Payment_Terms, RE_CO_Payment_Methods, RE_SA_Sales_Office, RE_SA_Price_Group_1, RE_SA_Price_Group_2, RE_SA_Delivery_Priority, RE_SA_Shipping_Condition, RE_SA_Acct_Assgmt_Group, RE_SA_Itcoterms, RE_Attributes1, RE_Attributes2, RE_Attributes3, RE_Attributes4, RE_Attributes5, RE_SA_Customer_Division_K1, RE_SA_Customer_Division_K2, RE_SA_Customer_Division_K3, NA_Existed_Code, NA_Customer_Name, NA_City, NA_Street, NA_Post_Code, NA_Fax_No, NA_Contact_Preson, NA_Tel, NA_Is_Have_Account, NA_Region, NA_Language, NA_Customer_Division_K1, NA_Customer_Division_K2, NA_Customer_Division_K3);
                SetEnable(TaskAPI.Step == "DMO Maintain", SAP_Code);
                SetEnable(TaskAPI.Step == "DMO Approve" | TaskAPI.Step == "DMO Maintain" | TaskAPI.Step == "DMO Check", DMO_DrpPriority);
                SetVisible(TaskAPI.Step == "DMO Approve" | TaskAPI.Step == "DMO Maintain" | TaskAPI.Step == "DMO Check", P_DMO);
                Assessment1.Enable = TaskAPI.IsAllowSubmit;
                SetVisible(TaskAPI.IsAllowSubmit, Send, Split);

                SetVisible(Actions.SelectedValue != "1", P1, P2, P3, P4);
                Attachment1.AllowDelete = TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit;
                Attachment1.AllowUpload = TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit;
                InitTabs();
                #endregion

                #region 加深颜色
                string item = null;
                string value = null;
                foreach (Control cr in this.Controls)
                {
                    if (cr is DropDownList)
                    {
                        DropDownList tb = (DropDownList)cr;
                        if (!tb.Enabled)
                        {
                            tb.Enabled = true;
                            item = tb.SelectedItem.Text;
                            value = tb.SelectedValue.ToString();
                            tb.Items.Clear();
                            tb.Items.Add(new ListItem(item, value));
                        }
                        tb.ForeColor = System.Drawing.Color.DimGray;
                    }
                }
                if (!flg || !TaskAPI.IsAllowSubmit)
                {

                    foreach (Control cr in P_VD.Controls)
                    {
                        if (cr is DropDownList)
                        {
                            DropDownList tb = (DropDownList)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_VD.Controls)
                    {
                        if (cr is TextBox)
                        {
                            TextBox tb = (TextBox)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ReadOnly = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA.Controls)
                    {
                        if (cr is DropDownList)
                        {
                            DropDownList tb = (DropDownList)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA.Controls)
                    {
                        if (cr is TextBox)
                        {
                            TextBox tb = (TextBox)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ReadOnly = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA2.Controls)
                    {
                        if (cr is DropDownList)
                        {
                            DropDownList tb = (DropDownList)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA2.Controls)
                    {
                        if (cr is TextBox)
                        {
                            TextBox tb = (TextBox)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ReadOnly = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA3.Controls)
                    {
                        if (cr is DropDownList)
                        {
                            DropDownList tb = (DropDownList)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }

                    foreach (Control cr in P_SA3.Controls)
                    {
                        if (cr is TextBox)
                        {
                            TextBox tb = (TextBox)cr;
                            if (!tb.Enabled)
                            {
                                tb.Enabled = true;
                                tb.ReadOnly = true;
                                tb.ForeColor = System.Drawing.Color.DimGray;
                            }
                        }
                    }
                }

                #endregion
            }
        }
        #endregion

        #region 事件 Send
        protected void Send_Click(object sender, EventArgs e)
        {
            try
            {
                #region 数据验证
                if (TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) // 如果是退回的情况，不存在验证
                {
                    List<string> vald_s = new List<string>();
                    vald_s.AddRange(DataValidation());
                    if (vald_s.Count > 0)
                    {
                        Anthem.Manager.AddScriptForClientSideEval(string.Format("ShowMessage(\"{0}\", {1});", CombineMessage(vald_s), vald_s.Count));
                        return;
                    }
                }
                #endregion

                #region 引擎传值
                if (TaskAPI.IsBeginStep)
                {
                    if (TaskAPI.IsInitiate)
                    {
                        ApplicationNo.Text = Util.GenerateSequence(((object[])TaskAPI["PrefixNo"])[0].ToString() + "-" + System.DateTime.Now.ToString("yyMM"), "", 4);
                        TaskAPI.UserName = UserAPI.UserName;
                        TaskAPI["ApplicationNo"] = ApplicationNo.Text;
                        TaskAPI["ApplicatorName"] = UserAPI.UserFullName;
                        TaskAPI["Applicator"] = UserAPI.UserName;
                        TaskAPI["Time"] = System.DateTime.Now.ToString("yyyy.MM.dd HH:mm:ss");
                        TaskAPI["ApplicatorEmail"] = UserAPI.Mail;
                        TaskAPI["Department"] = UserAPI.Department;
                        TaskAPI["ServerName"] = Util.AppSettings("ServerName");
                    }

                    TaskAPI.Summary = (Actions.SelectedItem.Text.Split(',').Length >= 2 ? Actions.SelectedItem.Text.Split(',')[1].Trim() : Actions.Text)
                                    + " / " + ApplicationNo.Text + (VD.Checked ? " / Customer " : "") + (SA.Checked ? " / Ship to " : "") + (SA2.Checked ? " / Rebate " : "") + (SA3.Checked ? " / Hierarchy " : "");

                    //TaskAPI["finance_Type"] = VD.Checked && VD_finance_Type.SelectedValue == "内部(Internal)" ? "Internal" : "";
                    TaskAPI["Actions"] = Actions.SelectedValue;
                    TaskAPI["Remark_by_Initiator"] = Assessment1.Assessment.Remark;
                    TaskAPI["DrpPriority"] = DrpPriority.SelectedItem.Text;

                    #region 从数据库取得流程步骤处理人
                    SortedList<string, string> rec_a = new SortedList<string, string>();

                    IList<mdc_Recipient> rec_s = (mdc_Recipient.process == TaskAPI.Process & (mdc_Recipient.distribute == Actions.SelectedValue | mdc_Recipient.distribute == "*") & mdc_Recipient.status == 1).List<mdc_Recipient>();
                    foreach (mdc_Recipient rec in rec_s)
                    {
                        if (!rec_a.ContainsKey(rec.Step))
                        {
                            rec_a.Add(rec.Step, rec.Recipient);
                            continue;
                        }

                        if (rec_a.Values[rec_a.IndexOfKey(rec.Step)].Contains(rec.Recipient))
                        {
                            continue;
                        }

                        rec_a[rec.Step] = rec_a.Values[rec_a.IndexOfKey(rec.Step)] + "," + rec.Recipient;
                    }

                    //步骤处理人赋值
                    for (int i = 0; i < rec_a.Keys.Count; i++)
                    {
                        TaskAPI["R_" + rec_a.Keys[i].Replace(" ", "_")] = rec_a.Values[i].Split(",".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
                    }

                    //m_OrgChart oc = (m_OrgChart.empID.In(m_OrgChart.dr2EmpID, m_OrgChart.winID == UserAPI.UserName)).ListFirst<m_OrgChart>();
                    //if(oc != null)
                    //{
                    //    TaskAPI["R_Manager_Approve2"] = oc.WinID;
                    //}
                    IList<m_TW_Choose> tw_choose = (m_TW_Choose.recipient == TaskAPI.UserName & m_TW_Choose.status == 1).List<m_TW_Choose>();
                    if (tw_choose.Count == 0)
                    {
                        TaskAPI["R_Manager_Approve"] = null;
                        m_OrgChart oc = (m_OrgChart.empID.In(m_OrgChart.supervisorEmpID, m_OrgChart.winID == UserAPI.UserName)).ListFirst<m_OrgChart>();
                        if (oc != null)
                        {
                            TaskAPI["R_Manager_Approve"] = oc.WinID;
                        }
                    }


                    #endregion
                }
                else
                {
                    TaskAPI["ApproveResult"] = Assessment1.Assessment.Opinion;
                    TaskAPI["TaskID"] = TaskAPI.TaskID;
                }



                //#region 退回步骤并返回功能 传值
                //if (!string.IsNullOrEmpty(Assessment1.JumpStep))
                //{
                //    TaskAPI["Step"] = Assessment1.JumpStep;
                //    TaskAPI["PreStep"] = TaskAPI.Step;
                //}
                //else
                //{
                //    string PreStep = ((object[])TaskAPI["PreStep"])[0].ToString();
                //    if (PreStep.Trim() != "")
                //    {
                //        TaskAPI["Step"]    = PreStep;
                //        TaskAPI["PreStep"] = "";
                //    }
                //    else
                //    {
                //        TaskAPI["Step"] = "";
                //        TaskAPI["PreStep"] = "";
                //    }
                //}
                //#endregion

                #endregion

                #region 提交步骤
                bool flg = false;
                Storage.TransactionExecute(o =>
                {
                    #region “Fill in the form”步骤
                    if (TaskAPI.IsBeginStep)
                    {
                        TW_cmd_Customer_Deco cmd = new TW_cmd_Customer_Deco();
                        if ((TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == TaskAPI.Incident & TW_cmd_Customer_Deco.userName == UserAPI.UserName).Count<TW_cmd_Customer_Deco>() > 0)
                        {
                            cmd = (TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == TaskAPI.Incident & TW_cmd_Customer_Deco.userName == UserAPI.UserName).ListFirst<TW_cmd_Customer_Deco>();
                        }
                        else
                        {
                            cmd.Process = TaskAPI.Process;
                            cmd.Incident = TaskAPI.Incident;
                            cmd.UserName = UserAPI.UserName;
                            cmd.UserFullName = UserAPI.UserFullName;
                            cmd.ApplicationNo = ApplicationNo.Text;
                            cmd.Time = System.DateTime.Now;
                            cmd.Status = 0;
                            cmd.Department = UserAPI.Department;
                        }

                        cmd.Actions = Actions.SelectedValue;
                        cmd.DrpPriority = DrpPriority.SelectedValue;
                        //finance.Actions           = Actions.SelectedItem.Text;

                        cmd.VD_Checked = VD.Checked ? "1" : "0";
                        cmd.SA_Checked = SA.Checked ? "1" : "0";
                        cmd.SA2_Checked = SA2.Checked ? "1" : "0";
                        cmd.SA3_Checked = SA3.Checked ? "1" : "0";

                        #region VD
                        if (VD.Checked)
                        {
                            cmd.BA_Existed_Sold_To_Code = BA_Existed_Sold_To_Code.Text;
                            cmd.BA_BPCS_Code = BA_BPCS_Code.Text;
                            cmd.BA_Customer_Name_In_ZH = BA_Customer_Name_In_ZH.Text;
                            cmd.BA_Search_Term_1 = BA_Search_Term_1.Text;
                            cmd.BA_Search_Term_2 = BA_Search_Term_2.Text;
                            cmd.BA_Hierarchy_1 = BA_Hierarchy_1.Text;
                            cmd.BA_Hierarchy_2 = BA_Hierarchy_2.Text;
                            cmd.BA_Country = BA_Country.Text;
                            cmd.BA_Existed_Sold_To_Code_City = BA_Existed_Sold_To_Code_City.Text;
                            cmd.BA_Street4 = BA_Street4.Text;
                            cmd.BA_Existed_Sold_To_Code_Address = BA_Existed_Sold_To_Code_Address.Text;
                            cmd.BA_Existed_Sold_To_Code_Contact_Preson = BA_Existed_Sold_To_Code_Contact_Preson.Text;
                            cmd.BA_Existed_Sold_To_Code_Tel = BA_Existed_Sold_To_Code_Tel.Text;
                            cmd.BA_Post_Code = BA_Post_Code.Text;
                            cmd.BA_Email = BA_Email.Text;
                            cmd.BA_Fax = BA_Fax.Text;
                            cmd.Internat_Name = Internat_Name.Text;
                            cmd.Internat_Seach_Term = Internat_Seach_Term.Text;
                            cmd.Internat_Language = Internat_Language.Text;
                            cmd.Internat_Address = Internat_Address.Text;
                            cmd.Internat_City = Internat_City.Text;
                            cmd.Internat_Tel = Internat_Tel.Text;
                            cmd.Internat_Mobile = Internat_Mobile.Text;
                            cmd.Internat_Mail = Internat_Mail.Text;
                            cmd.Internat_Fax = Internat_Fax.Text;
                            cmd.BA_Existed_Payer_To_Code = BA_Existed_Payer_To_Code.Text;
                            cmd.BA_Bill_Name1 = BA_Bill_Name1.Text;
                            cmd.BA_Bill_Search_Term1 = BA_Bill_Search_Term1.Text;
                            cmd.BA_Bill_Search_Term2 = BA_Bill_Search_Term2.Text;
                            cmd.BA_Bill_City = BA_Bill_City.Text;
                            cmd.BA_Bill_County_Code = BA_Bill_County_Code.Text;
                            cmd.BA_Bill_Street4 = BA_Bill_Street4.Text;
                            cmd.BA_Bill_Address = BA_Bill_Address.Text;
                            cmd.BA_Bill_Contact_Person = BA_Bill_Contact_Person.Text;
                            cmd.BA_Bill_Tel = BA_Bill_Tel.Text;
                            cmd.BA_Bill_Postal_Code = BA_Bill_Postal_Code.Text;
                            cmd.BA_Bill_Mail = BA_Bill_Mail.Text;
                            cmd.BA_Bill_Fax = BA_Bill_Fax.Text;
                            cmd.BA_Existed_Code = BA_Existed_Code.Text;
                            cmd.BA_Old_BPCS_Indirect = BA_Old_BPCS_Indirect.Text;
                            cmd.BA_Indirect_Name1 = BA_Indirect_Name1.Text;
                            cmd.BA_Indirect_Name2 = BA_Indirect_Name2.Text;
                            cmd.BA_Indirect_Search_Term1 = BA_Indirect_Search_Term1.Text;
                            cmd.BA_Indirect_Search_Term2 = BA_Indirect_Search_Term2.Text;
                            cmd.BA_Indirect_City = BA_Indirect_City.Text;
                            cmd.BA_Indirect_Street4 = BA_Indirect_Street4.Text;
                            cmd.BA_Indirect_Address = BA_Indirect_Address.Text;
                            cmd.BA_Indirect_Person = BA_Indirect_Person.Text;
                            cmd.BA_Indirect_Tel = BA_Indirect_Tel.Text;
                            cmd.BA_Indirect_Postal_Code = BA_Indirect_Postal_Code.Text;
                            cmd.BA_Indirect_Mail = BA_Indirect_Mail.Text;
                            cmd.BA_Indirect_Fax = BA_Indirect_Fax.Text;
                            //cmd.BA_Bazaar_Code = BA_Bazaar_Code.Text;
                            cmd.BA_Indirect_Transportation_Zone = BA_Indirect_Transportation_Zone.Text;
                            cmd.BA_Transportation_Zone = BA_Transportation_Zone.Text;
                            cmd.BA_Industry_Code2 = BA_Industry_Code2.Text;
                            cmd.BA_County_Code = BA_County_Code.Text;
                            cmd.BA_Tax_Number2 = BA_Tax_Number2.Text;
                            cmd.BA_Bank_Key = BA_Bank_Key.Text;
                            cmd.BA_Bank_Name = BA_Bank_Name.Text;
                            cmd.BA_Account = BA_Account.Text;
                            cmd.BA_Acct_Holder = BA_Acct_Holder.Text;
                            cmd.CO_Company = CO_Company.Text;
                            cmd.CO_Sort_Key = CO_Sort_Key.Text;
                            cmd.CO_BPCS = CO_BPCS.Text;
                            cmd.CO_Cash_Mgmt = CO_Cash_Mgmt.Text;
                            cmd.CO_Bank_Statement = CO_Bank_Statement.Text;
                            cmd.CO_Dunn_Procedure = CO_Dunn_Procedure.Text;
                            cmd.SA_Sales_Org = SA_Sales_Org.Text;
                            cmd.SA_Currency = SA_Currency.Text;
                            cmd.SA_Order_Combination = SA_Order_Combination.Text;
                            cmd.SA_Partial_Delivery_Per_Item = SA_Partial_Delivery_Per_Item.Text;
                            cmd.SA_Tax_Classification = SA_Tax_Classification.Text;
                            cmd.SA_Itcoterms2 = SA_Itcoterms2.Text;
                            cmd.SA_Departing_Country = SA_Departing_Country.Text;
                            cmd.SA_Customer_Group_3 = SA_Customer_Group_3.Text;
                            cmd.SA_Partner_Function = SA_Partner_Function.Text;
                            cmd.SA_Partner_Number = SA_Partner_Number.Text;
                            cmd.SA_Customer_Description = SA_Customer_Description.Text;
                            cmd.SA_Sales_Code = SA_Sales_Code.Text;
                            cmd.Text_Internal = Text_Internal.Text;
                            cmd.Text_Shipping = Text_Shipping.Text;
                            cmd.Text_Pay = Text_Pay.Text;
                            cmd.Text_External = Text_External.Text;
                            cmd.Attributes8 = Attributes8.Text;
                            cmd.Attributes9 = Attributes9.Text;
                            cmd.SA_Terms_Of_Payment = SA_Terms_Of_Payment.Text;
                            cmd.SA_Distribution_Channel = SA_Distribution_Channel.Text;
                            cmd.BA_Industry_Code3 = BA_Industry_Code3.Text;
                            cmd.SA_Delivering_Plant = SA_Delivering_Plant.Text;
                            cmd.BA_Cust_Pric = BA_Cust_Pric.Text;

                            cmd.BA_Sales_Employee = BA_Sales_Employee.SelectedValue;
                            cmd.BA_Account_Group = BA_Account_Group.SelectedValue;
                            cmd.BA_Region = BA_Region.SelectedValue;
                            cmd.BA_Language = BA_Language.SelectedValue;
                            cmd.BA_Default_BillTo = BA_Default_BillTo.SelectedValue;
                            cmd.BA_Bill_City_Code = BA_Bill_City_Code.SelectedValue;
                            cmd.BA_Default_Indirect = BA_Default_Indirect.SelectedValue;
                            cmd.BA_Industry = BA_Industry.SelectedValue;
                            cmd.BA_Bank_Country = BA_Bank_Country.SelectedValue;
                            cmd.CO_Recon_Account = CO_Recon_Account.SelectedValue;
                            cmd.CO_Payment_Terms = CO_Payment_Terms.SelectedValue;
                            cmd.CO_Payment_Methods = CO_Payment_Methods.SelectedValue;
                            cmd.SA_Sales_Office = SA_Sales_Office.SelectedValue;
                            cmd.SA_Price_Group_1 = SA_Price_Group_1.SelectedValue;
                            cmd.SA_Price_Group_2 = SA_Price_Group_2.SelectedValue;
                            cmd.SA_Delivery_Priority = SA_Delivery_Priority.SelectedValue;
                            cmd.SA_Shipping_Condition = SA_Shipping_Condition.SelectedValue;
                            cmd.SA_Acct_Assgmt_Group = SA_Acct_Assgmt_Group.SelectedValue;
                            cmd.SA_Itcoterms = SA_Itcoterms.SelectedValue;
                            cmd.SA_Max_Partial_Deliveries_1 = SA_Max_Partial_Deliveries_1.Text;
                            cmd.Attributes1 = Attributes1.SelectedValue;
                            cmd.Attributes2 = Attributes2.SelectedValue;
                            cmd.Attributes3 = Attributes3.SelectedValue;
                            cmd.Attributes4 = Attributes4.SelectedValue;
                            cmd.Attributes5 = Attributes5.SelectedValue;
                            cmd.Sales_District = Sales_District.SelectedValue;
                            cmd.Attributes7 = Attributes7.SelectedValue;
                            cmd.BA_City_Code = BA_City_Code.SelectedValue;
                            cmd.BA_APO_Group = BA_APO_Group.SelectedValue;
                            cmd.BA_Industry1 = BA_Industry1.SelectedValue;
                            cmd.BA_Instruction_Key = BA_Instruction_Key.SelectedValue;

                            cmd.SA_Customer_Division_K1 = SA_Customer_Division_K1.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_K2 = SA_Customer_Division_K2.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_K3 = SA_Customer_Division_K3.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_K6 = SA_Customer_Division_K6.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_10 = SA_Customer_Division_10.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_K7 = SA_Customer_Division_K7.Checked ? "1" : "0";
                            cmd.SA_Customer_Division_K8 = SA_Customer_Division_K8.Checked ? "1" : "0";
                            cmd.SA_Switch_Off_Rounding = SA_Switch_Off_Rounding.Checked ? "1" : "0";
                            cmd.SA_Relevant_For_POD = SA_Relevant_For_POD.Checked ? "1" : "0";
                            cmd.SA_Rebate = SA_Rebate.Checked ? "1" : "0";
                            cmd.SA_Price_Determin = SA_Price_Determin.Checked ? "1" : "0";
                            cmd.SA_Complete_Delivery_Reqd_By_Law = SA_Complete_Delivery_Reqd_By_Law.Checked ? "1" : "0";
                            cmd.CO_Payment_History_Record = CO_Payment_History_Record.Checked ? "1" : "0";

                        }
                        #endregion

                        #region SA
                        if (SA.Checked)
                        {
                            cmd.ST_Sold_To_No = ST_Sold_To_No.Text;
                            cmd.ST_Old_Ship_BPCS = ST_Old_Ship_BPCS.Text;
                            cmd.ST_Sold_To_Name = ST_Sold_To_Name.Text;
                            cmd.ST_Search_Term1 = ST_Search_Term1.Text;
                            cmd.ST_Search_Term2 = ST_Search_Term2.Text;
                            cmd.ST_Ship_To_No = ST_Ship_To_No.Text;
                            cmd.ST_Ship_To_Name = ST_Ship_To_Name.Text;
                            cmd.ST_Country = ST_Country.Text;
                            cmd.ST_City = ST_City.Text;
                            cmd.ST_Street4 = ST_Street4.Text;
                            cmd.ST_Address = ST_Address.Text;
                            cmd.ST_Contact_Person = ST_Contact_Person.Text;
                            cmd.ST_Tel = ST_Tel.Text;
                            cmd.ST_Postal_Code = ST_Postal_Code.Text;
                            cmd.ST_Mail = ST_Mail.Text;
                            cmd.ST_Fax = ST_Fax.Text;
                            cmd.ST_Transportation_Zone = ST_Transportation_Zone.Text;
                            cmd.ST_County_Code = ST_County_Code.Text;
                            cmd.ST_Sales_Org = ST_Sales_Org.Text;
                            cmd.ST_Currency = ST_Currency.Text;
                            cmd.ST_Delivering_Plant = ST_Delivering_Plant.Text;
                            cmd.ST_Tax_Classification = ST_Tax_Classification.Text;
                            cmd.ST_Itcoterms2 = ST_Itcoterms2.Text;
                            cmd.ST_Cus_Grp3 = ST_Cus_Grp3.Text;
                            cmd.ST_Partial_Delivery_Per_Item = ST_Partial_Delivery_Per_Item.Text;
                            cmd.ST_Max_Partial_Deliveries = ST_Max_Partial_Deliveries.Text;
                            cmd.ST_Depart_Country = ST_Depart_Country.Text;
                            cmd.ST_Attributes9 = ST_Attributes9.Text;
                            cmd.ST_Distribution = ST_Distribution.Text;
                            cmd.ST_Cust_Pric = ST_Cust_Pric.Text;

                            cmd.ST_Default_Ship = ST_Default_Ship.SelectedValue;
                            cmd.ST_DEL_ST_Address = ST_DEL_ST_Address.SelectedValue;
                            cmd.ST_Region = ST_Region.SelectedValue;
                            cmd.ST_Language = ST_Language.SelectedValue;
                            cmd.ST_Industry = ST_Industry.SelectedValue;
                            cmd.ST_Industry_Code1 = ST_Industry_Code1.SelectedValue;
                            cmd.ST_City_Code = ST_City_Code.SelectedValue;
                            cmd.ST_Sales_District = ST_Sales_District.SelectedValue;
                            cmd.ST_Sales_Office = ST_Sales_Office.SelectedValue;
                            cmd.ST_Delivery_Priority = ST_Delivery_Priority.SelectedValue;
                            cmd.ST_Shipping_Condition = ST_Shipping_Condition.SelectedValue;
                            cmd.ST_Acct_Assgmt_Group = ST_Acct_Assgmt_Group.SelectedValue;
                            cmd.ST_Itcoterms = ST_Itcoterms.SelectedValue;
                            cmd.ST_Attributes1 = ST_Attributes1.SelectedValue;
                            cmd.ST_Attributes2 = ST_Attributes2.SelectedValue;
                            cmd.ST_Attributes3 = ST_Attributes3.SelectedValue;
                            cmd.ST_Attributes4 = ST_Attributes4.SelectedValue;
                            cmd.ST_Price_Group_1 = ST_Price_Group_1.SelectedValue;
                            cmd.ST_Price_Group_2 = ST_Price_Group_2.SelectedValue;


                            cmd.ST_Customer_Division_K1 = ST_Customer_Division_K1.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_K2 = ST_Customer_Division_K2.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_K3 = ST_Customer_Division_K3.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_K6 = ST_Customer_Division_K6.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_10 = ST_Customer_Division_10.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_K7 = ST_Customer_Division_K7.Checked ? "1" : "0";
                            cmd.ST_Customer_Division_K8 = ST_Customer_Division_K8.Checked ? "1" : "0";
                            cmd.ST_Switch_Off_Rounding = ST_Switch_Off_Rounding.Checked ? "1" : "0";
                            cmd.ST_Relevant_For_POD = ST_Relevant_For_POD.Checked ? "1" : "0";
                            cmd.ST_Rebate = ST_Rebate.Checked ? "1" : "0";
                            cmd.ST_Price_Determin = ST_Price_Determin.Checked ? "1" : "0";
                            cmd.ST_Order_Combination = ST_Order_Combination.Checked ? "1" : "0";
                            cmd.ST_Complete_Delivery_Reqd_By_Law = ST_Complete_Delivery_Reqd_By_Law.Checked ? "1" : "0";



                        }
                        #endregion

                        #region SA2
                        if (SA2.Checked)
                        {
                            cmd.RE_BA_Existed_Sold_To_Code = RE_BA_Existed_Sold_To_Code.Text;
                            cmd.RE_BA_Account_Group = RE_BA_Account_Group.Text;
                            cmd.RE_BA_BPCS_Code = RE_BA_BPCS_Code.Text;
                            cmd.RE_BA_Customer_Name_In_ZH = RE_BA_Customer_Name_In_ZH.Text;
                            cmd.RE_BA_Search_Term_1 = RE_BA_Search_Term_1.Text;
                            cmd.RE_BA_Search_Term_2 = RE_BA_Search_Term_2.Text;
                            cmd.RE_BA_Hierarchy_1 = RE_BA_Hierarchy_1.Text;
                            cmd.RE_BA_Hierarchy_2 = RE_BA_Hierarchy_2.Text;
                            cmd.RE_BA_Country = RE_BA_Country.Text;
                            cmd.RE_BA_Existed_Sold_To_Code_City = RE_BA_Existed_Sold_To_Code_City.Text;
                            cmd.RE_BA_SoldTo_Code = RE_BA_SoldTo_Code.Text;
                            cmd.RE_BA_Street4 = RE_BA_Street4.Text;
                            cmd.RE_BA_Existed_Sold_To_Code_Address = RE_BA_Existed_Sold_To_Code_Address.Text;
                            cmd.RE_BA_Existed_Sold_To_Code_Contact_Preson = RE_BA_Existed_Sold_To_Code_Contact_Preson.Text;
                            cmd.RE_BA_Existed_Sold_To_Code_Tel = RE_BA_Existed_Sold_To_Code_Tel.Text;
                            cmd.RE_BA_Post_Code = RE_BA_Post_Code.Text;
                            cmd.RE_BA_Email = RE_BA_Email.Text;
                            cmd.RE_BA_Fax = RE_BA_Fax.Text;
                            cmd.RE_BA_Transportation_Zone = RE_BA_Transportation_Zone.Text;

                            cmd.RE_BA_County_Code = RE_BA_County_Code.Text;
                            cmd.RE_BA_Tax_Number2 = RE_BA_Tax_Number2.Text;
                            cmd.RE_BA_Bank_Key = RE_BA_Bank_Key.Text;
                            cmd.RE_BA_Bank_Name = RE_BA_Bank_Name.Text;
                            cmd.RE_BA_Account = RE_BA_Account.Text;
                            cmd.RE_BA_Acct_Holder = RE_BA_Acct_Holder.Text;
                            cmd.RE_CO_Company = RE_CO_Company.Text;
                            cmd.RE_CO_Sort_Key = RE_CO_Sort_Key.Text;
                            cmd.RE_CO_BPCS = RE_CO_BPCS.Text;
                            cmd.RE_CO_Cash_Mgmt = RE_CO_Cash_Mgmt.Text;
                            cmd.RE_CO_Bank_Statement = RE_CO_Bank_Statement.Text;
                            cmd.RE_CO_Dunn_Procedure = RE_CO_Dunn_Procedure.Text;
                            cmd.RE_SA_Sales_Org = RE_SA_Sales_Org.Text;
                            cmd.RE_SA_Currency = RE_SA_Currency.Text;
                            cmd.RE_SA_Partial_Delivery_Per_Item = RE_SA_Partial_Delivery_Per_Item.Text;
                            cmd.RE_SA_Max_Partial_Deliveries_1 = RE_SA_Max_Partial_Deliveries_1.Text;
                            cmd.RE_SA_Order_Combination = RE_SA_Order_Combination.Text;
                            cmd.RE_SA_Tax_Classification = RE_SA_Tax_Classification.Text;
                            cmd.RE_SA_Itcoterms2 = RE_SA_Itcoterms2.Text;
                            cmd.RE_SA_Departing_Country = RE_SA_Departing_Country.Text;
                            cmd.RE_SA_Terms_Of_Payment = RE_SA_Terms_Of_Payment.Text;
                            cmd.RE_SA_Customer_Group_3 = RE_SA_Customer_Group_3.Text;
                            cmd.RE_SA_Partner_Function = RE_SA_Partner_Function.Text;
                            cmd.RE_SA_Partner_Number = RE_SA_Partner_Number.Text;
                            cmd.RE_SA_Customer_Description = RE_SA_Customer_Description.Text;
                            cmd.RE_SA_Sales_Code = RE_SA_Sales_Code.Text;
                            cmd.RE_Text_Internal = RE_Text_Internal.Text;
                            cmd.RE_Text_Shipping = RE_Text_Shipping.Text;
                            cmd.RE_Text_Pay = RE_Text_Pay.Text;
                            cmd.RE_Text_External = RE_Text_External.Text;
                            cmd.RE_Sales_District = RE_Sales_District.SelectedValue;
                            cmd.RE_Attributes9 = RE_Attributes9.Text;
                            cmd.RE_BA_Industry_Code2 = RE_BA_Industry_Code2.Text;
                            cmd.RE_SA_Distribution_Channel = RE_SA_Distribution_Channel.Text;
                            cmd.RE_BA_Industry_Code3 = RE_BA_Industry_Code3.Text;
                            cmd.RE_Attributes8 = RE_Attributes8.Text;
                            cmd.RE_SA_Delivering_Plant = RE_SA_Delivering_Plant.Text;
                            cmd.RE_BA_Cust_Pric = RE_BA_Cust_Pric.Text;

                            cmd.RE_BA_Sales_Employee = RE_BA_Sales_Employee.SelectedValue;
                            cmd.RE_BA_Region = RE_BA_Region.SelectedValue;
                            cmd.RE_BA_Language = RE_BA_Language.SelectedValue;
                            cmd.RE_BA_Industry = RE_BA_Industry.SelectedValue;
                            cmd.RE_BA_Industry1 = RE_BA_Industry1.SelectedValue;
                            cmd.RE_BA_Instruction_Key = RE_BA_Instruction_Key.SelectedValue;
                            cmd.RE_BA_APO_Group = RE_BA_APO_Group.SelectedValue;
                            cmd.RE_BA_City_Code = RE_BA_City_Code.SelectedValue;
                            cmd.RE_BA_Bank_Country = RE_BA_Bank_Country.SelectedValue;
                            cmd.RE_CO_Recon_Account = RE_CO_Recon_Account.SelectedValue;
                            cmd.RE_CO_Payment_Terms = RE_CO_Payment_Terms.SelectedValue;
                            cmd.RE_CO_Payment_Methods = RE_CO_Payment_Methods.SelectedValue;
                            cmd.RE_SA_Sales_Office = RE_SA_Sales_Office.SelectedValue;
                            cmd.RE_SA_Price_Group_1 = RE_SA_Price_Group_1.SelectedValue;
                            cmd.RE_SA_Price_Group_2 = RE_SA_Price_Group_2.SelectedValue;
                            cmd.RE_SA_Delivery_Priority = RE_SA_Delivery_Priority.SelectedValue;
                            cmd.RE_SA_Shipping_Condition = RE_SA_Shipping_Condition.SelectedValue;
                            cmd.RE_SA_Acct_Assgmt_Group = RE_SA_Acct_Assgmt_Group.SelectedValue;
                            cmd.RE_SA_Itcoterms = RE_SA_Itcoterms.SelectedValue;
                            cmd.RE_Attributes1 = RE_Attributes1.SelectedValue;
                            cmd.RE_Attributes2 = RE_Attributes2.SelectedValue;
                            cmd.RE_Attributes3 = RE_Attributes3.SelectedValue;
                            cmd.RE_Attributes4 = RE_Attributes4.SelectedValue;
                            cmd.RE_Attributes5 = RE_Attributes5.SelectedValue;
                            cmd.RE_Sales_District = RE_Sales_District.SelectedValue;
                            cmd.RE_Attributes7 = RE_Attributes7.SelectedValue;



                            cmd.RE_SA_Customer_Division_K1 = RE_SA_Customer_Division_K1.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_K2 = RE_SA_Customer_Division_K2.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_K3 = RE_SA_Customer_Division_K3.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_K6 = RE_SA_Customer_Division_K6.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_10 = RE_SA_Customer_Division_10.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_K7 = RE_SA_Customer_Division_K7.Checked ? "1" : "0";
                            cmd.RE_SA_Customer_Division_K8 = RE_SA_Customer_Division_K8.Checked ? "1" : "0";
                            cmd.RE_SA_Switch_Off_Rounding = RE_SA_Switch_Off_Rounding.Checked ? "1" : "0";
                            cmd.RE_SA_Relevant_For_POD = RE_SA_Relevant_For_POD.Checked ? "1" : "0";
                            cmd.RE_SA_Rebate = RE_SA_Rebate.Checked ? "1" : "0";
                            cmd.RE_SA_Price_Determin = RE_SA_Price_Determin.Checked ? "1" : "0";
                            cmd.RE_SA_Complete_Delivery_Reqd_By_Law = RE_SA_Complete_Delivery_Reqd_By_Law.Checked ? "1" : "0";
                            cmd.RE_CO_Payment_History_Record = RE_CO_Payment_History_Record.Checked ? "1" : "0";


                        }
                        #endregion

                        #region SA3
                        if (SA3.Checked)
                        {
                            cmd.NA_Existed_Code = NA_Existed_Code.Text;
                            cmd.NA_Customer_Name = NA_Customer_Name.Text;
                            cmd.NA_City = NA_City.Text;
                            cmd.NA_Street = NA_Street.Text;
                            cmd.NA_Post_Code = NA_Post_Code.Text;
                            cmd.NA_Fax_No = NA_Fax_No.Text;
                            cmd.NA_Contact_Preson = NA_Contact_Preson.Text;
                            cmd.NA_Tel = NA_Tel.Text;

                            cmd.NA_Is_Have_Account = NA_Is_Have_Account.SelectedValue;
                            cmd.NA_Region = NA_Region.SelectedValue;
                            cmd.NA_Language = NA_Language.SelectedValue;

                            cmd.NA_Customer_Division_K1 = NA_Customer_Division_K1.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_K2 = NA_Customer_Division_K2.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_K3 = NA_Customer_Division_K3.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_K6 = NA_Customer_Division_K6.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_10 = NA_Customer_Division_10.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_K7 = NA_Customer_Division_K7.Checked ? "1" : "0";
                            cmd.NA_Customer_Division_K8 = NA_Customer_Division_K8.Checked ? "1" : "0";
                            cmd.NA_Rebate = NA_Rebate.Checked ? "1" : "0";
                            cmd.NA_Price = NA_Price.Checked ? "1" : "0";

                        }
                        #endregion



                        (t_Attachment.process == TaskAPI.Process & t_Attachment.incident == 0 & t_Attachment.username == UserAPI.UserName).Edit<t_Attachment>(p =>
                        {
                            p.Incident = TaskAPI.Incident;
                        });

                        Storage.Save(Storage.Context1, cmd);
                    }
                    #endregion

                    #region Priority功能
                    if (TaskAPI.IsBeginStep && !string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {
                        mdc_Priority pro;
                        if ((mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).Count<mdc_Priority>() > 0)
                        {
                            pro = new mdc_Priority();
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.Business_Priority = Convert.ToInt32(DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }
                        else
                        {
                            pro = new mdc_Priority();
                            pro.Process = TaskAPI.Process;
                            pro.Incident = TaskAPI.Incident;
                            pro.Business_Priority = Convert.ToInt32(DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }

                    }


                    if ((TaskAPI.Step == "DMO Maintain" || TaskAPI.Step == "DMO Approve" || TaskAPI.Step == "DMO Check") && !string.IsNullOrEmpty(this.DMO_DrpPriority.SelectedValue) && !string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {

                        //mdc_Priority pro;
                        //pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                        //pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                        //Storage.Save(pro);
                        mdc_Priority pro;
                        if ((mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).Count<mdc_Priority>() > 0)
                        {
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }
                        else
                        {
                            pro = (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == TaskAPI.Incident).ListFirst<mdc_Priority>();
                            pro.DMO_Priority = Convert.ToInt32(DMO_DrpPriority.SelectedValue);
                            Storage.Save(pro);
                        }


                    }
                    #endregion

                    #region “DMO Maintain”步骤
                    if (TaskAPI.Step == "DMO Maintain")
                    {
                        (TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == TaskAPI.Incident).Edit<TW_cmd_Customer_Deco>(p =>
                        {
                            p.SAP_Code = SAP_Code.Text;
                        }
                        );
                    }

                    if (TaskAPI.Step == "DMO Maintain" || TaskAPI.Step == "DMO Approve" || TaskAPI.Step == "DMO Check")
                    {

                        TaskAPI["DMO_DrpPriority"] = DMO_DrpPriority.SelectedItem.Text;
                        (TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == TaskAPI.Incident).Edit<TW_cmd_Customer_Deco>(p =>
                        {
                            // p.SAP_Code = SAP_Code.Text;
                            p.DMO_DrpPriority = DMO_DrpPriority.SelectedValue;

                        }
                        );
                    }
                    #endregion

                    Storage.Save(Assessment1.Assessment);    //审批意见

                    //多节点退回
                    if (!string.IsNullOrEmpty(Assessment1.JumpStep))
                    {
                        Assessment1.SetAsReturn(true);
                        TaskAPI.DirectActive(Assessment1.JumpStep);
                    }
                    else
                    {
                        Assessment1.SetAsReturn(false);
                    }
                    Assessment1.SubmitTo();
                    flg = TaskAPI.Send();
                });

                //如果数据库写入成功且流程发起成功的情况，将业务表数据与流程实例号进行关联
                if (TaskAPI.IsInitiate)
                {
                    if (!string.IsNullOrEmpty(DrpPriority.SelectedValue))
                    {
                        (mdc_Priority.process == TaskAPI.Process & mdc_Priority.incident == 0).Edit<mdc_Priority>(p =>
                        {
                            p.Incident = TaskAPI.Incident;
                        });
                    }

                    (TW_cmd_Customer_Deco.process == TaskAPI.Process & TW_cmd_Customer_Deco.incident == 0 & TW_cmd_Customer_Deco.userName == UserAPI.UserName).Edit<TW_cmd_Customer_Deco>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });

                    (t_Assessment.process == TaskAPI.Process & t_Assessment.incident == 0 & t_Assessment.assignedToUserName == UserAPI.UserName).Edit<t_Assessment>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });


                    (t_Attachment.process == TaskAPI.Process & t_Attachment.incident == 0 & t_Attachment.username == UserAPI.UserName).Edit<t_Attachment>(p =>
                    {
                        p.Incident = TaskAPI.Incident;
                    });
                }
                #endregion

                Send.Visible = false;
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('" + Resources.Global.C_00_Success + "',true)");
            }
            catch (Exception ex)
            {
                TaskDB.Log("", false, "调用NVA方法Send_Click出错：" + ex.ToString());
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('" + Resources.Global.C_00_Failed + "',false)");
            }
        }
        #endregion

        #region 事件 CheckedChanged
        protected void VD_CheckedChanged(object sender, EventArgs e)
        {

            if (!VD.Checked && !SA.Checked && !SA2.Checked && !SA3.Checked)
            {
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('至少保留一个选择项！',false)");
                VD.Checked = true;
            }
            if (!VD.Checked && SA.Checked && !SA2.Checked && !SA3.Checked)
            {
                Anthem.Manager.AddScriptForClientSideEval("JSInfomation('若申请ShipTo，请选择TW Customer Master-Ship To！',false)");
                VD.Checked = true;
            }
            SetVisible(false, P_VD, P_SA, P_SA2, P_SA3);
            switch (((Anthem.CheckBox)sender).ID)
            {
                case "VD":

                    if (VD.Checked)
                    {
                        //SA.Checked = false;
                        //SA2.Checked = false;
                        //SA3.Checked = false;
                        VD_L.Visible = VD.Checked;
                    }
                    //VD.Checked = !(SA.Checked | SA2.Checked);

                    //VD_L.Visible = VD.Checked;
                    break;
                case "SA":
                    if (SA.Checked)
                    {
                        //VD.Checked = false;
                        //SA2.Checked = false;
                        //SA3.Checked = false;
                        SA_L.Visible = SA.Checked;
                    }
                    //SA_L.Visible = SA.Checked;
                    //if (!SA.Checked & !SA2.Checked) SA.Checked = true;
                    //VD.Checked = !(SA.Checked | SA2.Checked);
                    //SA_L.Visible = SA.Checked;
                    //if (!SA.Checked & SA2.Checked) { SA2_L.CssClass = "tabs1"; Tabs_Click(SA2_L, e); }
                    break;

                case "SA2":
                    if (SA2.Checked)
                    {
                        //VD.Checked = false;
                        //SA.Checked = false;
                        //SA3.Checked = false;
                        SA2_L.Visible = SA2.Checked;
                    }

                    //SA2_L.Visible = SA2.Checked;
                    //if (!SA.Checked & !SA2.Checked) SA2.Checked = true;
                    //VD.Checked = !(SA.Checked | SA2.Checked);
                    //SA2_L.Visible = SA2.Checked;
                    break;

                case "SA3":
                    if (SA3.Checked)
                    {
                        //VD.Checked = false;
                        //SA.Checked = false;
                        //SA2.Checked = false;
                        SA3_L.Visible = SA3.Checked;
                    }
                    //SA3_L.Visible = SA3.Checked;
                    break;

            }

            InitTabs();
        }
        #endregion

        #region 事件 Actions变换
        protected void Actions_SelectedIndexChanged(object sender, EventArgs e)
        {
            SetColor();
            SetEnable((Actions.SelectedValue == "1" || Actions.SelectedValue == "2" || Actions.SelectedValue == "3" || Actions.SelectedValue == "4"));
            if (Actions.SelectedValue != "1")
            {
                SetVisible(true, P1, P2, P3, P4);
            }
            else
            {
                SetVisible(false, P1, P2, P3, P4);
            }
        }
        #endregion

        #region 事件 Tabs切换
        protected void Tabs_Click(object sender, EventArgs e)
        {
            if (((LinkButton)sender).CssClass == "tabs2")
            {
                return;
            }

            #region 初始化
            SetVisible(false, P_VD, P_SA, P_SA2, P_SA3);
            VD_L.CssClass = "tabs1";
            SA_L.CssClass = "tabs1";
            SA2_L.CssClass = "tabs1";
            SA3_L.CssClass = "tabs1";
            #endregion

            #region Tabs切换动作
            switch (((LinkButton)sender).ID)
            {
                case "VD_L":
                    VD_L.CssClass = "tabs2";
                    P_VD.Visible = true;
                    break;
                case "SA_L":
                    SA_L.CssClass = "tabs2";
                    P_SA.Visible = true;
                    break;
                case "SA2_L":
                    SA2_L.CssClass = "tabs2";
                    P_SA2.Visible = true;
                    break;
                case "SA3_L":
                    SA3_L.CssClass = "tabs2";
                    P_SA3.Visible = true;
                    break;

            }
            #endregion
        }
        #endregion

        #region 方法 初始化Tabs
        protected void InitTabs()
        {
            VD_L.Visible = VD.Checked;
            SA_L.Visible = SA.Checked;
            SA2_L.Visible = SA2.Checked;
            SA3_L.Visible = SA3.Checked;


            SetVisible(false, P_VD, P_SA, P_SA2, P_SA3);
            VD_L.CssClass = "tabs1";
            SA_L.CssClass = "tabs1";
            SA2_L.CssClass = "tabs1";
            SA3_L.CssClass = "tabs1";


            //默认第1个显示 Tabs被选中
            if (VD_L.Visible)
            {
                VD_L.CssClass = "tabs2";
                P_VD.Visible = true;
                return;
            }

            if (SA_L.Visible)
            {
                SA_L.CssClass = "tabs2";
                P_SA.Visible = true;
                return;
            }

            if (SA2_L.Visible)
            {
                SA2_L.CssClass = "tabs2";
                P_SA2.Visible = true;
                return;
            }

            if (SA3_L.Visible)
            {
                SA3_L.CssClass = "tabs2";
                P_SA3.Visible = true;
                return;
            }



        }
        #endregion

        #region 方法 SetColor
        protected void SetColor()
        {
            SetForeColor(Color.Black, BA_Existed_Sold_To_Code_L, BA_Region_L, ST_Language_L, RE_BA_Region_L, RE_BA_Existed_Sold_To_Code_L, ST_Sold_To_No_L, NA_Existed_Code_L, BA_Account_Group_L, BA_Customer_Name_In_ZH_L, BA_Existed_Sold_To_Code_City_L, BA_Existed_Sold_To_Code_Address_L, BA_Industry_L, BA_Account_Group_L, BA_Sales_Employee_L, BA_Language_L, BA_City_Code_L, CO_Recon_Account_L, CO_Payment_Terms_L, CO_Payment_Methods_L, SA_Sales_Office_L, SA_Delivery_Priority_L, SA_Shipping_Condition_L, SA_Acct_Assgmt_Group_L, SA_Itcoterms_L, ST_Sold_To_Name_L, ST_Ship_To_Name_L, ST_City_L, ST_Address_L, ST_Contact_Person_L, RE_BA_Customer_Name_In_ZH_L, RE_BA_SoldTo_Code_L, RE_BA_Existed_Sold_To_Code_City_L, RE_BA_Existed_Sold_To_Code_Address_L, RE_BA_Sales_Employee_L, RE_BA_Language_L, RE_BA_Industry_L, RE_BA_City_Code_L, RE_CO_Recon_Account_L, RE_CO_Payment_Terms_L, RE_CO_Payment_Methods_L, RE_SA_Sales_Office_L, RE_SA_Delivery_Priority_L, RE_SA_Shipping_Condition_L, RE_SA_Acct_Assgmt_Group_L, RE_SA_Itcoterms_L, NA_Customer_Name_L, NA_City_L, NA_Region_L, NA_Language_L);

            switch (Actions.SelectedValue)
            {
                case "1":
                    SetForeColor(Color.Blue, BA_Account_Group_L, ST_Language_L, BA_Region_L, RE_BA_Region_L, BA_Customer_Name_In_ZH_L, BA_Existed_Sold_To_Code_City_L, BA_Existed_Sold_To_Code_Address_L, BA_Industry_L, BA_Account_Group_L, BA_Sales_Employee_L, BA_Language_L, BA_City_Code_L, CO_Recon_Account_L, CO_Payment_Terms_L, CO_Payment_Methods_L, SA_Sales_Office_L, SA_Delivery_Priority_L, SA_Shipping_Condition_L, SA_Acct_Assgmt_Group_L, SA_Itcoterms_L, ST_Sold_To_Name_L, ST_Ship_To_Name_L, ST_City_L, ST_Address_L, ST_Contact_Person_L, RE_BA_Customer_Name_In_ZH_L, RE_BA_SoldTo_Code_L, RE_BA_Existed_Sold_To_Code_City_L, RE_BA_Existed_Sold_To_Code_Address_L, RE_BA_Sales_Employee_L, RE_BA_Language_L, RE_BA_Industry_L, RE_BA_City_Code_L, RE_CO_Recon_Account_L, RE_CO_Payment_Terms_L, RE_CO_Payment_Methods_L, RE_SA_Sales_Office_L, RE_SA_Delivery_Priority_L, RE_SA_Shipping_Condition_L, RE_SA_Acct_Assgmt_Group_L, RE_SA_Itcoterms_L, NA_Customer_Name_L, NA_City_L, NA_Region_L, NA_Language_L);
                    break;

                case "2":
                    SetForeColor(Color.Blue, BA_Existed_Sold_To_Code_L, RE_BA_Existed_Sold_To_Code_L, ST_Sold_To_No_L, ST_Ship_To_No_L, NA_Existed_Code_L, BA_Customer_Name_In_ZH_L, RE_BA_Customer_Name_In_ZH_L, ST_Sold_To_Name_L, NA_Customer_Name_L);
                    break;

                case "3":
                    SetForeColor(Color.Blue, BA_Existed_Sold_To_Code_L, RE_BA_Existed_Sold_To_Code_L, ST_Sold_To_No_L, ST_Ship_To_No_L, NA_Existed_Code_L, BA_Customer_Name_In_ZH_L, RE_BA_Customer_Name_In_ZH_L, ST_Sold_To_Name_L, NA_Customer_Name_L);
                    break;

                case "4":
                    SetForeColor(Color.Blue, BA_Existed_Sold_To_Code_L, RE_BA_Existed_Sold_To_Code_L, ST_Sold_To_No_L, ST_Ship_To_No_L, NA_Existed_Code_L, BA_Customer_Name_In_ZH_L, RE_BA_Customer_Name_In_ZH_L, ST_Sold_To_Name_L, NA_Customer_Name_L);
                    break;
            }
        }
        #endregion

        #region 方法 SetDefaultValue(设置默认值, 并禁用输入)
        public void SetDefaultValue()
        {

            BA_Country.Text = "TW Taiwan";
            CO_Sort_Key.Text = "031";
            CO_Cash_Mgmt.Text = "";
            CO_Bank_Statement.Text = "2";
            SA_Sales_Org.Text = "TW01";
            SA_Distribution_Channel.Text = "10(3rd party)";
            SA_Order_Combination.Text = "";
            SA_Tax_Classification.Text = "1";
            SA_Departing_Country.Text = "TW";
            //SA_Customer_Group_3.Text="001";
            SA_Partial_Delivery_Per_Item.Text = "";
            SA_Delivering_Plant.Text = "KT1D";
            RE_SA_Delivering_Plant.Text = "KT1D";
            SA_Currency.Text = "TWD";
            CO_Dunn_Procedure.Text = "TW00";
            SA_Max_Partial_Deliveries_1.Text = "9";
            ST_Country.Text = "TW";
            ST_Transportation_Zone.Text = "TWOTH00000";
            ST_Sales_Org.Text = "TW01";
            ST_Currency.Text = "TWD";
            ST_Distribution.Text = "10(3rd party)";
            ST_Delivering_Plant.Text = "KT1D DECO";
            ST_Tax_Classification.Text = "1";
            ST_Cus_Grp3.Text = "";
            ST_Cust_Pric.Text = "1 Standard";
            BA_Cust_Pric.Text = "1 Standard";
            RE_BA_Cust_Pric.Text = "1 Standard";
            ST_Partial_Delivery_Per_Item.Text = "";
            ST_Max_Partial_Deliveries.Text = "9";
            ST_Depart_Country.Text = "TW";
            RE_BA_Account_Group.Text = "Z001 Sold to-customer";
            RE_BA_Country.Text = "TW Taiwan";
            RE_CO_Sort_Key.Text = "031";
            RE_CO_Cash_Mgmt.Text = "";
            RE_CO_Bank_Statement.Text = "2";
            RE_SA_Sales_Org.Text = "TW01";
            RE_SA_Currency.Text = "TWD";
            RE_SA_Distribution_Channel.Text = "10(3rd party)";
            RE_SA_Partial_Delivery_Per_Item.Text = "";
            RE_SA_Max_Partial_Deliveries_1.Text = "9";
            RE_SA_Order_Combination.Text = "";
            RE_SA_Tax_Classification.Text = "1";
            RE_SA_Departing_Country.Text = "TW";
            //RE_SA_Customer_Group_3.Text="001";
            RE_CO_Dunn_Procedure.Text = "TW00";
            BA_Indirect_Transportation_Zone.Text = "TWOTH00000";
            BA_Transportation_Zone.Text = "TWOTH00000";
            RE_BA_Transportation_Zone.Text = "TWOTH00000";
            CO_Company.Text = "4239";
            RE_CO_Company.Text = "4239";
            SA_Switch_Off_Rounding.Checked = true;
            SA_Relevant_For_POD.Checked = true;
            SA_Rebate.Checked = true;
            SA_Price_Determin.Checked = true;
            SA_Complete_Delivery_Reqd_By_Law.Checked = false;
            RE_SA_Switch_Off_Rounding.Checked = true;
            RE_SA_Relevant_For_POD.Checked = true;
            RE_SA_Rebate.Checked = true;
            RE_SA_Price_Determin.Checked = true;
            RE_SA_Complete_Delivery_Reqd_By_Law.Checked = false;
            NA_Rebate.Checked = true;
            NA_Price.Checked = true;
            CO_Payment_History_Record.Checked = true;
            RE_CO_Payment_History_Record.Checked = true;
            ST_Switch_Off_Rounding.Checked = true;
            ST_Relevant_For_POD.Checked = true;
            ST_Rebate.Checked = true;
            ST_Price_Determin.Checked = true;
            ST_Order_Combination.Checked = false;
            ST_Complete_Delivery_Reqd_By_Law.Checked = false;

            SetEnable(false, RE_BA_Account_Group, ST_Cust_Pric, BA_Cust_Pric, RE_BA_Cust_Pric, CO_Sort_Key, SA_Delivering_Plant, RE_SA_Delivering_Plant, SA_Distribution_Channel, ST_Switch_Off_Rounding, ST_Relevant_For_POD, ST_Rebate, ST_Price_Determin, ST_Order_Combination, ST_Distribution, RE_SA_Distribution_Channel, ST_Complete_Delivery_Reqd_By_Law, ST_Complete_Delivery_Reqd_By_Law, CO_Cash_Mgmt, CO_Company, RE_CO_Company, CO_Payment_History_Record, CO_Bank_Statement, SA_Sales_Org, SA_Order_Combination, SA_Tax_Classification, SA_Partial_Delivery_Per_Item, CO_Dunn_Procedure, SA_Max_Partial_Deliveries_1, SA_Switch_Off_Rounding, SA_Relevant_For_POD, SA_Rebate, SA_Price_Determin, SA_Complete_Delivery_Reqd_By_Law, ST_Country, ST_Sales_Org, ST_Delivering_Plant, ST_Tax_Classification, ST_Cus_Grp3, ST_Partial_Delivery_Per_Item, ST_Max_Partial_Deliveries, ST_Depart_Country, SA_Switch_Off_Rounding, SA_Relevant_For_POD, SA_Rebate, SA_Price_Determin, SA_Complete_Delivery_Reqd_By_Law, RE_CO_Sort_Key, RE_CO_Cash_Mgmt, RE_CO_Payment_History_Record, RE_CO_Bank_Statement, RE_SA_Sales_Org, RE_SA_Partial_Delivery_Per_Item, RE_SA_Max_Partial_Deliveries_1, RE_SA_Order_Combination, RE_SA_Tax_Classification, RE_CO_Dunn_Procedure, RE_SA_Switch_Off_Rounding, RE_SA_Relevant_For_POD, RE_SA_Rebate, RE_SA_Price_Determin, RE_SA_Complete_Delivery_Reqd_By_Law, NA_Rebate, NA_Price);
            SetForeColor(Color.Orange, RE_BA_Account_Group_L, ST_Cust_Pric_L, BA_Cust_Pric_L, RE_BA_Cust_Pric_L, SA_Delivering_Plant_L, RE_SA_Delivering_Plant_L, SA_Distribution_Channel_L, ST_Distribution_L, RE_SA_Distribution_Channel_L, BA_Country_L, ST_Switch_Off_Rounding_L, ST_Relevant_For_POD_L, ST_Rebate_L, ST_Price_Determin_L, ST_Complete_Delivery_Reqd_By_Law_L, ST_Order_Combination_L, CO_Company_L, RE_CO_Company_L, CO_Sort_Key_L, BA_Indirect_Transportation_Zone_L, BA_Transportation_Zone_L, RE_BA_Transportation_Zone_L, CO_Cash_Mgmt_L, CO_Payment_History_Record_L, CO_Bank_Statement_L, SA_Sales_Org_L, SA_Order_Combination_L, SA_Tax_Classification_L, SA_Departing_Country_L, SA_Partial_Delivery_Per_Item_L, SA_Currency_L, CO_Dunn_Procedure_L, SA_Max_Partial_Deliveries_1_L, SA_Switch_Off_Rounding_L, SA_Relevant_For_POD_L, SA_Rebate_L, SA_Price_Determin_L, SA_Complete_Delivery_Reqd_By_Law_L, ST_Country_L, ST_Transportation_Zone_L, ST_Sales_Org_L, ST_Currency_L, ST_Delivering_Plant_L, ST_Tax_Classification_L, ST_Cus_Grp3_L, ST_Partial_Delivery_Per_Item_L, ST_Max_Partial_Deliveries_L, ST_Depart_Country_L, SA_Switch_Off_Rounding_L, SA_Relevant_For_POD_L, SA_Rebate_L, SA_Price_Determin_L, SA_Complete_Delivery_Reqd_By_Law_L, RE_BA_Country_L, RE_CO_Sort_Key_L, RE_CO_Cash_Mgmt_L, RE_CO_Payment_History_Record_L, RE_CO_Bank_Statement_L, RE_SA_Sales_Org_L, RE_SA_Currency_L, RE_SA_Partial_Delivery_Per_Item_L, RE_SA_Max_Partial_Deliveries_1_L, RE_SA_Order_Combination_L, RE_SA_Tax_Classification_L, RE_SA_Departing_Country_L, RE_CO_Dunn_Procedure_L, RE_SA_Switch_Off_Rounding_L, RE_SA_Relevant_For_POD_L, RE_SA_Rebate_L, RE_SA_Price_Determin_L, RE_SA_Complete_Delivery_Reqd_By_Law_L, NA_Rebate_L, NA_Price_L);
        }
        #endregion

        #region 方法 InitDropdownList
        private void InitDropDownList()
        {
            if (!IsLoaded)
            {
                BA_Account_Group.Items.Clear();
                BA_Account_Group.Items.Add(new ListItem("", ""));
                IList<m_TW_Account_Group> hys = (m_TW_Account_Group.status == 1).List<m_TW_Account_Group>();
                foreach (m_TW_Account_Group HY in hys)
                {
                    BA_Account_Group.Items.Add(new ListItem(HY.Account_Group, HY.Account_Group));
                }

                BA_Region.Items.Clear();
                ST_Region.Items.Clear();
                RE_BA_Region.Items.Clear();
                NA_Region.Items.Clear();
                BA_Region.Items.Add(new ListItem("", ""));
                ST_Region.Items.Add(new ListItem("", ""));
                RE_BA_Region.Items.Add(new ListItem("", ""));
                NA_Region.Items.Add(new ListItem("", ""));
                IList<m_TW_Region> h1 = (m_TW_Region.status == 1).List<m_TW_Region>();
                foreach (m_TW_Region HY in h1)
                {
                    BA_Region.Items.Add(new ListItem(HY.TW_Region, HY.TW_Region));
                    ST_Region.Items.Add(new ListItem(HY.TW_Region, HY.TW_Region));
                    RE_BA_Region.Items.Add(new ListItem(HY.TW_Region, HY.TW_Region));
                    NA_Region.Items.Add(new ListItem(HY.TW_Region, HY.TW_Region));
                }


                BA_Bill_City_Code.Items.Clear();
                BA_City_Code.Items.Clear();
                ST_City_Code.Items.Clear();
                RE_BA_City_Code.Items.Clear();
                BA_Bill_City_Code.Items.Add(new ListItem("", ""));
                BA_City_Code.Items.Add(new ListItem("", ""));
                ST_City_Code.Items.Add(new ListItem("", ""));
                RE_BA_City_Code.Items.Add(new ListItem("", ""));
                IList<m_TW_City_Code> h3 = (m_TW_City_Code.status == 1).List<m_TW_City_Code>();
                foreach (m_TW_City_Code HY in h3)
                {
                    BA_Bill_City_Code.Items.Add(new ListItem(HY.City_Code, HY.City_Code));
                    BA_City_Code.Items.Add(new ListItem(HY.City_Code, HY.City_Code));
                    ST_City_Code.Items.Add(new ListItem(HY.City_Code, HY.City_Code));
                    RE_BA_City_Code.Items.Add(new ListItem(HY.City_Code, HY.City_Code));
                }


                BA_Industry.Items.Clear();
                RE_BA_Industry.Items.Clear();
                ST_Industry.Items.Clear();
                BA_Industry.Items.Add(new ListItem("", ""));
                RE_BA_Industry.Items.Add(new ListItem("", ""));
                ST_Industry.Items.Add(new ListItem("", ""));
                IList<m_TW_Industry_Global> h4 = (m_TW_Industry_Global.status == 1).List<m_TW_Industry_Global>();
                foreach (m_TW_Industry_Global HY in h4)
                {
                    BA_Industry.Items.Add(new ListItem(HY.TW_Industry_Global, HY.TW_Industry_Global));
                    RE_BA_Industry.Items.Add(new ListItem(HY.TW_Industry_Global, HY.TW_Industry_Global));
                    ST_Industry.Items.Add(new ListItem(HY.TW_Industry_Global, HY.TW_Industry_Global));
                }


                BA_Industry1.Items.Clear();
                RE_BA_Industry1.Items.Clear();
                ST_Industry_Code1.Items.Clear();
                BA_Industry1.Items.Add(new ListItem("", ""));
                RE_BA_Industry1.Items.Add(new ListItem("", ""));
                ST_Industry_Code1.Items.Add(new ListItem("", ""));
                IList<m_TW_Industry_Code1_Local> h5 = (m_TW_Industry_Code1_Local.status == 1).List<m_TW_Industry_Code1_Local>();
                foreach (m_TW_Industry_Code1_Local HY in h5)
                {
                    BA_Industry1.Items.Add(new ListItem(HY.Industry_Code1_Local, HY.Industry_Code1_Local));
                    RE_BA_Industry1.Items.Add(new ListItem(HY.Industry_Code1_Local, HY.Industry_Code1_Local));
                    ST_Industry_Code1.Items.Add(new ListItem(HY.Industry_Code1_Local, HY.Industry_Code1_Local));
                }


                //BA_Industry_Code3.Items.Clear();
                //RE_BA_Industry_Code3.Items.Clear();
                //BA_Industry_Code3.Items.Add(new ListItem("", ""));
                //RE_BA_Industry_Code3.Items.Add(new ListItem("", ""));
                //IList<m_TW_Industry_Code_3_Corp> h6 = (m_TW_Industry_Code_3_Corp.status == 1).List<m_TW_Industry_Code_3_Corp>();
                //foreach (m_TW_Industry_Code_3_Corp HY in h6)
                //{
                //    BA_Industry_Code3.Items.Add(new ListItem(HY.Industry_Code_3_Corp, HY.Industry_Code_3_Corp));
                //    RE_BA_Industry_Code3.Items.Add(new ListItem(HY.Industry_Code_3_Corp, HY.Industry_Code_3_Corp));
                //}


                CO_Recon_Account.Items.Clear();
                RE_CO_Recon_Account.Items.Clear();
                CO_Recon_Account.Items.Add(new ListItem("", ""));
                RE_CO_Recon_Account.Items.Add(new ListItem("", ""));
                IList<m_TW_CO_Recon_Account> h7 = (m_TW_CO_Recon_Account.status == 1).List<m_TW_CO_Recon_Account>();
                foreach (m_TW_CO_Recon_Account HY in h7)
                {
                    CO_Recon_Account.Items.Add(new ListItem(HY.CO_Recon_Account, HY.CO_Recon_Account));
                    RE_CO_Recon_Account.Items.Add(new ListItem(HY.CO_Recon_Account, HY.CO_Recon_Account));
                }


                CO_Payment_Terms.Items.Clear();
                RE_CO_Payment_Terms.Items.Clear();
                CO_Payment_Terms.Items.Add(new ListItem("", ""));
                RE_CO_Payment_Terms.Items.Add(new ListItem("", ""));
                IList<m_TW_Payment_Terms> h8 = (m_TW_Payment_Terms.status == 1).List<m_TW_Payment_Terms>();
                foreach (m_TW_Payment_Terms HY in h8)
                {
                    CO_Payment_Terms.Items.Add(new ListItem(HY.Payment_Terms, HY.Payment_Terms));
                    RE_CO_Payment_Terms.Items.Add(new ListItem(HY.Payment_Terms, HY.Payment_Terms));
                }


                CO_Payment_Methods.Items.Clear();
                RE_CO_Payment_Methods.Items.Clear();
                CO_Payment_Methods.Items.Add(new ListItem("", ""));
                RE_CO_Payment_Methods.Items.Add(new ListItem("", ""));
                IList<m_TW_Payment_Methods> h9 = (m_TW_Payment_Methods.status == 1).List<m_TW_Payment_Methods>();
                foreach (m_TW_Payment_Methods HY in h9)
                {
                    CO_Payment_Methods.Items.Add(new ListItem(HY.Payment_Methods, HY.Payment_Methods));
                    RE_CO_Payment_Methods.Items.Add(new ListItem(HY.Payment_Methods, HY.Payment_Methods));
                }


                SA_Sales_Office.Items.Clear();
                RE_SA_Sales_Office.Items.Clear();
                ST_Sales_Office.Items.Clear();
                SA_Sales_Office.Items.Add(new ListItem("", ""));
                RE_SA_Sales_Office.Items.Add(new ListItem("", ""));
                ST_Sales_Office.Items.Add(new ListItem("", ""));
                IList<m_TW_Sales_Office> h10 = (m_TW_Sales_Office.status == 1).List<m_TW_Sales_Office>();
                foreach (m_TW_Sales_Office HY in h10)
                {
                    SA_Sales_Office.Items.Add(new ListItem(HY.Sales_Office, HY.Sales_Office));
                    RE_SA_Sales_Office.Items.Add(new ListItem(HY.Sales_Office, HY.Sales_Office));
                    ST_Sales_Office.Items.Add(new ListItem(HY.Sales_Office, HY.Sales_Office));
                }


                SA_Price_Group_1.Items.Clear();
                SA_Price_Group_2.Items.Clear();
                RE_SA_Price_Group_1.Items.Clear();
                RE_SA_Price_Group_2.Items.Clear();
                ST_Price_Group_1.Items.Clear();
                ST_Price_Group_2.Items.Clear();
                SA_Price_Group_1.Items.Add(new ListItem("", ""));
                SA_Price_Group_2.Items.Add(new ListItem("", ""));
                RE_SA_Price_Group_1.Items.Add(new ListItem("", ""));
                RE_SA_Price_Group_2.Items.Add(new ListItem("", ""));
                ST_Price_Group_1.Items.Add(new ListItem("", ""));
                ST_Price_Group_2.Items.Add(new ListItem("", ""));
                IList<m_TW_Price_Group> h11 = (m_TW_Price_Group.status == 1).List<m_TW_Price_Group>();
                foreach (m_TW_Price_Group HY in h11)
                {
                    SA_Price_Group_1.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    SA_Price_Group_2.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    RE_SA_Price_Group_1.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    RE_SA_Price_Group_2.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    ST_Price_Group_1.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                    ST_Price_Group_2.Items.Add(new ListItem(HY.Price_Group, HY.Price_Group));
                }


                //BA_Cust_Pric.Items.Clear();
                //RE_BA_Cust_Pric.Items.Clear();
                //ST_Cust_Pric.Items.Clear();
                //BA_Cust_Pric.Items.Add(new ListItem("", ""));
                //RE_BA_Cust_Pric.Items.Add(new ListItem("", ""));
                //ST_Cust_Pric.Items.Add(new ListItem("", ""));
                //IList<m_TW_Cust_Pric_Proc> h12 = (m_TW_Cust_Pric_Proc.status == 1).List<m_TW_Cust_Pric_Proc>();
                //foreach (m_TW_Cust_Pric_Proc HY in h12)
                //{
                //    BA_Cust_Pric.Items.Add(new ListItem(HY.Cust_Pric_Proc, HY.Cust_Pric_Proc));
                //    RE_BA_Cust_Pric.Items.Add(new ListItem(HY.Cust_Pric_Proc, HY.Cust_Pric_Proc));
                //    ST_Cust_Pric.Items.Add(new ListItem(HY.Cust_Pric_Proc, HY.Cust_Pric_Proc));
                //}


                SA_Delivery_Priority.Items.Clear();
                RE_SA_Delivery_Priority.Items.Clear();
                ST_Delivery_Priority.Items.Clear();
                SA_Delivery_Priority.Items.Add(new ListItem("", ""));
                RE_SA_Delivery_Priority.Items.Add(new ListItem("", ""));
                ST_Delivery_Priority.Items.Add(new ListItem("", ""));
                IList<m_TW_Delivery_Priority> h13 = (m_TW_Delivery_Priority.status == 1).List<m_TW_Delivery_Priority>();
                foreach (m_TW_Delivery_Priority HY in h13)
                {
                    SA_Delivery_Priority.Items.Add(new ListItem(HY.Delivery_Priority, HY.Delivery_Priority));
                    RE_SA_Delivery_Priority.Items.Add(new ListItem(HY.Delivery_Priority, HY.Delivery_Priority));
                    ST_Delivery_Priority.Items.Add(new ListItem(HY.Delivery_Priority, HY.Delivery_Priority));
                }


                SA_Shipping_Condition.Items.Clear();
                RE_SA_Shipping_Condition.Items.Clear();
                ST_Shipping_Condition.Items.Clear();
                SA_Shipping_Condition.Items.Add(new ListItem("", ""));
                RE_SA_Shipping_Condition.Items.Add(new ListItem("", ""));
                ST_Shipping_Condition.Items.Add(new ListItem("", ""));
                IList<m_TW_Shipping_Conditions> h14 = (m_TW_Shipping_Conditions.status == 1).List<m_TW_Shipping_Conditions>();
                foreach (m_TW_Shipping_Conditions HY in h14)
                {
                    SA_Shipping_Condition.Items.Add(new ListItem(HY.Shipping_Conditions, HY.Shipping_Conditions));
                    RE_SA_Shipping_Condition.Items.Add(new ListItem(HY.Shipping_Conditions, HY.Shipping_Conditions));
                    ST_Shipping_Condition.Items.Add(new ListItem(HY.Shipping_Conditions, HY.Shipping_Conditions));
                }


                ST_Itcoterms.Items.Clear();
                SA_Itcoterms.Items.Clear();
                RE_SA_Itcoterms.Items.Clear();
                ST_Itcoterms.Items.Add(new ListItem("", ""));
                SA_Itcoterms.Items.Add(new ListItem("", ""));
                RE_SA_Itcoterms.Items.Add(new ListItem("", ""));
                IList<m_TW_Incoterms> h15 = (m_TW_Incoterms.status == 1).List<m_TW_Incoterms>();
                foreach (m_TW_Incoterms HY in h15)
                {
                    ST_Itcoterms.Items.Add(new ListItem(HY.Incoterms, HY.Incoterms));
                    SA_Itcoterms.Items.Add(new ListItem(HY.Incoterms, HY.Incoterms));
                    RE_SA_Itcoterms.Items.Add(new ListItem(HY.Incoterms, HY.Incoterms));
                }


                ST_Acct_Assgmt_Group.Items.Clear();
                SA_Acct_Assgmt_Group.Items.Clear();
                RE_SA_Acct_Assgmt_Group.Items.Clear();
                ST_Acct_Assgmt_Group.Items.Add(new ListItem("", ""));
                SA_Acct_Assgmt_Group.Items.Add(new ListItem("", ""));
                RE_SA_Acct_Assgmt_Group.Items.Add(new ListItem("", ""));
                IList<m_TW_Acct_Assgmt_Group> h16 = (m_TW_Acct_Assgmt_Group.status == 1).List<m_TW_Acct_Assgmt_Group>();
                foreach (m_TW_Acct_Assgmt_Group HY in h16)
                {
                    ST_Acct_Assgmt_Group.Items.Add(new ListItem(HY.Acct_Assgmt_Group, HY.Acct_Assgmt_Group));
                    SA_Acct_Assgmt_Group.Items.Add(new ListItem(HY.Acct_Assgmt_Group, HY.Acct_Assgmt_Group));
                    RE_SA_Acct_Assgmt_Group.Items.Add(new ListItem(HY.Acct_Assgmt_Group, HY.Acct_Assgmt_Group));
                }


                ST_Attributes1.Items.Clear();
                Attributes1.Items.Clear();
                RE_Attributes1.Items.Clear();
                ST_Attributes1.Items.Add(new ListItem("", ""));
                Attributes1.Items.Add(new ListItem("", ""));
                RE_Attributes1.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes1> h17 = (m_TW_Attributes1.status == 1).List<m_TW_Attributes1>();
                foreach (m_TW_Attributes1 HY in h17)
                {
                    ST_Attributes1.Items.Add(new ListItem(HY.TW_Attributes1, HY.TW_Attributes1));
                    Attributes1.Items.Add(new ListItem(HY.TW_Attributes1, HY.TW_Attributes1));
                    RE_Attributes1.Items.Add(new ListItem(HY.TW_Attributes1, HY.TW_Attributes1));
                }

                ST_Attributes2.Items.Clear();
                Attributes2.Items.Clear();
                RE_Attributes2.Items.Clear();
                ST_Attributes2.Items.Add(new ListItem("", ""));
                Attributes2.Items.Add(new ListItem("", ""));
                RE_Attributes2.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes2> h18 = (m_TW_Attributes2.status == 1).List<m_TW_Attributes2>();
                foreach (m_TW_Attributes2 HY in h18)
                {
                    ST_Attributes2.Items.Add(new ListItem(HY.TW_Attributes2, HY.TW_Attributes2));
                    Attributes2.Items.Add(new ListItem(HY.TW_Attributes2, HY.TW_Attributes2));
                    RE_Attributes2.Items.Add(new ListItem(HY.TW_Attributes2, HY.TW_Attributes2));
                }

                ST_Attributes3.Items.Clear();
                Attributes3.Items.Clear();
                RE_Attributes3.Items.Clear();
                ST_Attributes3.Items.Add(new ListItem("", ""));
                Attributes3.Items.Add(new ListItem("", ""));
                RE_Attributes3.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes3> h19 = (m_TW_Attributes3.status == 1).List<m_TW_Attributes3>();
                foreach (m_TW_Attributes3 HY in h19)
                {
                    ST_Attributes3.Items.Add(new ListItem(HY.TW_Attributes3, HY.TW_Attributes3));
                    Attributes3.Items.Add(new ListItem(HY.TW_Attributes3, HY.TW_Attributes3));
                    RE_Attributes3.Items.Add(new ListItem(HY.TW_Attributes3, HY.TW_Attributes3));
                }

                ST_Attributes4.Items.Clear();
                Attributes4.Items.Clear();
                RE_Attributes4.Items.Clear();
                ST_Attributes4.Items.Add(new ListItem("", ""));
                Attributes4.Items.Add(new ListItem("", ""));
                RE_Attributes4.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes4> h20 = (m_TW_Attributes4.status == 1).List<m_TW_Attributes4>();
                foreach (m_TW_Attributes4 HY in h20)
                {
                    ST_Attributes4.Items.Add(new ListItem(HY.TW_Attributes4, HY.TW_Attributes4));
                    Attributes4.Items.Add(new ListItem(HY.TW_Attributes4, HY.TW_Attributes4));
                    RE_Attributes4.Items.Add(new ListItem(HY.TW_Attributes4, HY.TW_Attributes4));
                }


                Attributes5.Items.Clear();
                RE_Attributes5.Items.Clear();
                Attributes5.Items.Add(new ListItem("", ""));
                RE_Attributes5.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes5> h21 = (m_TW_Attributes5.status == 1).List<m_TW_Attributes5>();
                foreach (m_TW_Attributes5 HY in h21)
                {

                    Attributes5.Items.Add(new ListItem(HY.TW_Attributes5, HY.TW_Attributes5));
                    RE_Attributes5.Items.Add(new ListItem(HY.TW_Attributes5, HY.TW_Attributes5));
                }


                Sales_District.Items.Clear();
                RE_Sales_District.Items.Clear();
                Sales_District.Items.Add(new ListItem("", ""));
                RE_Sales_District.Items.Add(new ListItem("", ""));

                ST_Sales_District.Items.Clear();
                ST_Sales_District.Items.Add(new ListItem("", ""));
                IList<m_TW_Sales_District> h25 = (m_TW_Sales_District.status == 1).List<m_TW_Sales_District>();
                foreach (m_TW_Sales_District HY in h25)
                {

                    Sales_District.Items.Add(new ListItem(HY.Sales_District, HY.Sales_District));
                    RE_Sales_District.Items.Add(new ListItem(HY.Sales_District, HY.Sales_District));
                    ST_Sales_District.Items.Add(new ListItem(HY.Sales_District, HY.Sales_District));
                }

                Attributes7.Items.Clear();
                RE_Attributes7.Items.Clear();
                Attributes7.Items.Add(new ListItem("", ""));
                RE_Attributes7.Items.Add(new ListItem("", ""));
                IList<m_TW_Attributes7> h26 = (m_TW_Attributes7.status == 1).List<m_TW_Attributes7>();
                foreach (m_TW_Attributes7 HY in h26)
                {

                    Attributes7.Items.Add(new ListItem(HY.Attributes7, HY.Attributes7));
                    RE_Attributes7.Items.Add(new ListItem(HY.Attributes7, HY.Attributes7));
                }

                BA_Bank_Country.Items.Clear();
                RE_BA_Bank_Country.Items.Clear();
                BA_Bank_Country.Items.Add(new ListItem("", ""));
                RE_BA_Bank_Country.Items.Add(new ListItem("", ""));
                IList<m_TW_Bank_Country> h22 = (m_TW_Bank_Country.status == 1).List<m_TW_Bank_Country>();
                foreach (m_TW_Bank_Country HY in h22)
                {

                    BA_Bank_Country.Items.Add(new ListItem(HY.Bank_Country, HY.Bank_Country));
                    RE_BA_Bank_Country.Items.Add(new ListItem(HY.Bank_Country, HY.Bank_Country));
                }


                BA_Sales_Employee.Items.Clear();
                RE_BA_Sales_Employee.Items.Clear();
                BA_Sales_Employee.Items.Add(new ListItem("", ""));
                RE_BA_Sales_Employee.Items.Add(new ListItem("", ""));
                IList<m_TW_Employee> h23 = (m_TW_Employee.status == 1).List<m_TW_Employee>();
                foreach (m_TW_Employee HY in h23)
                {

                    BA_Sales_Employee.Items.Add(new ListItem(HY.Employee, HY.Employee));
                    RE_BA_Sales_Employee.Items.Add(new ListItem(HY.Employee, HY.Employee));
                }


                BA_APO_Group.Items.Clear();
                RE_BA_APO_Group.Items.Clear();
                BA_APO_Group.Items.Add(new ListItem("", ""));
                RE_BA_APO_Group.Items.Add(new ListItem("", ""));
                IList<m_TW_Customer_Group_Deco> h24 = (m_TW_Customer_Group_Deco.status == 1).List<m_TW_Customer_Group_Deco>();
                foreach (m_TW_Customer_Group_Deco HY in h24)
                {

                    BA_APO_Group.Items.Add(new ListItem(HY.APO_Customer, HY.APO_Customer));
                    RE_BA_APO_Group.Items.Add(new ListItem(HY.APO_Customer, HY.APO_Customer));

                }

                BA_Instruction_Key.Items.Clear();
                RE_BA_Instruction_Key.Items.Clear();
                BA_Instruction_Key.Items.Add(new ListItem("", ""));
                RE_BA_Instruction_Key.Items.Add(new ListItem("", ""));
                IList<m_TW_Instruction_Key> h27 = (m_TW_Instruction_Key.status == 1).List<m_TW_Instruction_Key>();
                foreach (m_TW_Instruction_Key HY in h27)
                {

                    BA_Instruction_Key.Items.Add(new ListItem(HY.Instruction_Key, HY.Instruction_Key));
                    RE_BA_Instruction_Key.Items.Add(new ListItem(HY.Instruction_Key, HY.Instruction_Key));

                }

                IsLoaded = true;
            }
        }
        #endregion

        #region 方法 数据验证
        private List<string> DataValidation()
        {
            List<string> vald_s = new List<string>();
            List<string> vald_s_2 = new List<string>();
            List<string> vald_s_3 = new List<string>();
            List<string> vald_s_4 = new List<string>();
            List<string> vald_s_5 = new List<string>();
            List<Regular> regs = new List<Regular>();



            #region VD
            if (VD.Checked && Actions.SelectedValue == "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Account_Group.SelectedValue, "Account Group 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Customer_Name_In_ZH.Text, "Name 1 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Existed_Sold_To_Code_City.Text, "City(鄉鎮市) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Existed_Sold_To_Code_Address.Text, "Street/House No(詳細地址) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Industry.SelectedValue, "Industry(Global) 必填"));

                //regs.Add(new Regular(RegularExp.NotEmpty, BA_Bank_Key.Text, "Bank Key(銀行代碼) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, BA_Bank_Name.Text, "Bank Name(銀行名稱) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, BA_Account.Text, "Bank account(銀行帳號) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Sales_Employee.SelectedValue, "Sales Person 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Language.SelectedValue, "Language 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Region.SelectedValue, "Region(縣市) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_City_Code.SelectedValue, "City code(城市代碼)) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, CO_Recon_Account.SelectedValue, "Recon. Account(統馭科目)) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, CO_Payment_Terms.SelectedValue, "Payment Terms(付款條件) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, SA_Sales_Office.SelectedValue, "Sales Office(銷售區域) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, Sales_District.SelectedValue, "Sales District 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, CO_Payment_Methods.SelectedValue, "Payment Methods(支付方法) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, SA_Delivery_Priority.SelectedValue, "Delivery Priority(交貨優先級) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, SA_Shipping_Condition.SelectedValue, "Shipping Conditions(運輸條件) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, BA_Cust_Pric.SelectedValue, "Cust.pric.proc. 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, SA_Acct_Assgmt_Group.SelectedValue, "Acct assgmt group 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, SA_Itcoterms.SelectedValue, "Incoterms 必填"));
                if (!SA_Customer_Division_K1.Checked && !SA_Customer_Division_K2.Checked && !SA_Customer_Division_K3.Checked && !SA_Customer_Division_K6.Checked && !SA_Customer_Division_10.Checked && !SA_Customer_Division_K7.Checked && !SA_Customer_Division_K8.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3 或 4.MRT-K6 或 5.KA Project-K7 或 6.Null-K8 或 7.Gen-Exp-10 至少需要填写 1 个"));
                }
                if (SA_Customer_Division_K1.Checked && Actions.SelectedValue == "1")
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, SA_Price_Group_1.SelectedValue, " Price Group(K1) 必填"));
                }
                if (SA_Customer_Division_K2.Checked && Actions.SelectedValue == "1")
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, SA_Price_Group_2.SelectedValue, " Price Group(K2) 必填"));
                }

            }

            if (VD.Checked && Actions.SelectedValue != "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Existed_Sold_To_Code.Text, "Existed Customer Code 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, BA_Customer_Name_In_ZH.Text, "Name 1 必填"));
                //if (!SA_Customer_Division_K1.Checked && !SA_Customer_Division_K2.Checked && !SA_Customer_Division_K3.Checked)
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3至少需要填写 1 个"));
                //}

            }

            vald_s = Validation(regs);
            if (vald_s.Count > 0)
            {
                vald_s.Insert(0, "<font color='#0000FF'><b>Customer</b></font>");
            }
            #endregion

            #region SA
            regs.Clear();
            if (SA.Checked && Actions.SelectedValue == "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_Name.Text, "Sold to Name(公司名称)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Ship_To_Name.Text, "Ship to Name 1(送貨地阯名稱)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_City.Text, "City(鄉鎮市)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Language.SelectedIndex, "Language  必填"));

                regs.Add(new Regular(RegularExp.NotEmpty, ST_Address.Text, "House No./street(詳細地址)  必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Contact_Person.Text, "C/O(聯繫人)  必填"));
                // regs.Add(new Regular(RegularExp.NotEmpty, ST_City_Code.SelectedValue, "City code(城市代碼)  必填"));

                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Sales_District.SelectedValue, "Sales District  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Sales_Office.SelectedValue, "Sales Office(銷售區域)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Cust_Pric.SelectedValue, "Cust.pric.proc.(客戶定價過程)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Acct_Assgmt_Group.SelectedValue, "Acct assgmt group:.(客戶定價過程)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Itcoterms.SelectedValue, "Itcoterms  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Delivery_Priority.SelectedValue, "Delivery Priority(交貨優先級)  必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, ST_Shipping_Condition.SelectedValue, "Shipping Conditions(運輸條件)  必填"));
                if (!ST_Customer_Division_K1.Checked && !ST_Customer_Division_K2.Checked && !ST_Customer_Division_K3.Checked && !ST_Customer_Division_K6.Checked && !ST_Customer_Division_10.Checked && !ST_Customer_Division_K7.Checked && !ST_Customer_Division_K8.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3 或 4.MRT-K6 或 5.KA Project-K7 或 6.Null-K8  或 7.Gen-Exp-10 至少需要填写 1 个"));
                }

            }

            if (SA.Checked && Actions.SelectedValue != "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_No.Text, "Sold to No.客户编号   必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Sold_To_Name.Text, "Sold to Name(公司名称)   必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, ST_Ship_To_No.Text, "Existed ship to Code  必填"));
                //if (!ST_Customer_Division_K1.Checked && !ST_Customer_Division_K2.Checked && !ST_Customer_Division_K3.Checked)
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3至少需要填写 1 个"));
                //}
            }

            vald_s_2 = Validation(regs);
            if (vald_s_2.Count > 0)
            {
                vald_s_2.Insert(0, "<font color='#0000FF'><b>Ship to</b></font>");
                vald_s.AddRange(vald_s_2);
            }

            #endregion


            #region SA2
            regs.Clear();
            if (SA2.Checked && Actions.SelectedValue == "1")
            {

                // regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Account_Group.Text, "Bank account(銀行帳號) 必填"));

                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_SoldTo_Code.Text, "Sold to Code 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Customer_Name_In_ZH.Text, "Name 1 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Existed_Sold_To_Code_City.Text, "City(鄉鎮市) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Existed_Sold_To_Code_Address.Text, "Street/House No(詳細地址) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Bank_Key.Text, "Bank Key(銀行代碼) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Bank_Name.Text, "Bank Name(銀行名稱) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Sales_Employee.SelectedValue, "Sales Person 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Language.SelectedValue, "Language 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Region.SelectedValue, "Region(縣市) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Industry.SelectedValue, "Industry(Global) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_City_Code.SelectedValue, "City code(城市代碼) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_CO_Recon_Account.SelectedValue, "Recon. Account(統馭科目) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_CO_Payment_Terms.SelectedValue, "Payment Terms(付款條件) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_CO_Payment_Methods.SelectedValue, "Payment Methods(支付方法) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Sales_Office.SelectedValue, "Sales Office(銷售區域) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, RE_Sales_District.SelectedValue, "Sales_District 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Delivery_Priority.SelectedValue, "Delivery Priority(交貨優先級) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Shipping_Condition.SelectedValue, "Shipping Conditions(運輸條件) 必填"));
                //regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Cust_Pric.SelectedValue, "Cust.pric.proc. 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Acct_Assgmt_Group.SelectedValue, "Acct assgmt group 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Itcoterms.SelectedValue, "Incoterms 必填"));
                if (!RE_SA_Customer_Division_K1.Checked && !RE_SA_Customer_Division_K2.Checked && !RE_SA_Customer_Division_K3.Checked && !RE_SA_Customer_Division_K6.Checked && !RE_SA_Customer_Division_10.Checked && !RE_SA_Customer_Division_K7.Checked && !RE_SA_Customer_Division_K8.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3 或 4.MRT-K6 或 5.KA Project-K7 或 6.KA Project-K8 或 7.Gen-Exp-10 至少需要填写 1 个"));
                }
                if (RE_SA_Customer_Division_K1.Checked && Actions.SelectedValue == "1")
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Price_Group_1.SelectedValue, " Price Group(K1) 必填"));
                }
                if (RE_SA_Customer_Division_K2.Checked && Actions.SelectedValue == "1")
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, RE_SA_Price_Group_2.SelectedValue, " Price Group(K2) 必填"));
                }
            }

            if (SA2.Checked && Actions.SelectedValue != "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Existed_Sold_To_Code.Text, "Existed Rebate Code 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, RE_BA_Customer_Name_In_ZH.Text, "Name 1 必填"));
                //if (!RE_SA_Customer_Division_K1.Checked && !RE_SA_Customer_Division_K2.Checked && RE_SA_Customer_Division_K3.Checked)
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3至少需要填写 1 个"));
                //}
            }

            vald_s_3 = Validation(regs);
            if (vald_s_3.Count > 0)
            {
                vald_s_3.Insert(0, "<font color='#0000FF'><b>Payer for Rebate</b></font>");
                vald_s.AddRange(vald_s_3);
            }
            #endregion

            #region SA3
            regs.Clear();
            if (SA3.Checked && Actions.SelectedValue == "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, NA_Customer_Name.Text, " Customer Name 客戶名稱 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, NA_City.Text, "City(鄉鎮市) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, NA_Region.SelectedValue, "Region(縣市代碼) 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, NA_Language.SelectedValue, "Language 必填"));
                if (!NA_Customer_Division_K1.Checked && !NA_Customer_Division_K2.Checked && !NA_Customer_Division_K3.Checked && !NA_Customer_Division_K6.Checked && !NA_Customer_Division_10.Checked && !NA_Customer_Division_K7.Checked && !NA_Customer_Division_K8.Checked)
                {
                    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3 或 4.MRT-K6 或 5.KA Project-K7 或 6.Null-K8 或 7.Gen-Exp-10 至少需要填写 1 个"));
                }
            }

            if (SA3.Checked && Actions.SelectedValue != "1")
            {
                regs.Add(new Regular(RegularExp.NotEmpty, NA_Existed_Code.Text, "Existed Code(原帳號號碼 必填"));
                regs.Add(new Regular(RegularExp.NotEmpty, NA_Customer_Name.Text, "Customer Name 客戶名稱 必填"));
                //if (!NA_Customer_Division_K1.Checked && !NA_Customer_Division_K2.Checked && NA_Customer_Division_K3.Checked)
                //{
                //    regs.Add(new Regular(RegularExp.NotEmpty, "", "1.Retail-K1 或 2.Project-K2 或 3.Modern Trade-K3至少需要填写 1 个"));
                //}
            }

            vald_s_4 = Validation(regs);
            if (vald_s_4.Count > 0)
            {
                vald_s_4.Insert(0, "<font color='#0000FF'><b>Hierarchy(申請)</b></font>");
                vald_s.AddRange(vald_s_4);
            }
            #endregion



            return vald_s;
            //return Validation(regs);
        }
        #endregion

        #region 方法 Others
        private string getFormCheckList(Anthem.CheckBoxList ck)
        {
            string t = "";
            for (int i = 0; i < ck.Items.Count; i++)
                if (ck.Items[i].Selected)
                    t += "," + ck.Items[i].Value;
                else
                    t += ",";
            return t;
        }
        private Anthem.CheckBoxList setCheckList(string t, Anthem.CheckBoxList ck)
        {
            try
            {
                string[] tt = t.Split(',');

                for (int i = 0; i <= tt.GetUpperBound(0); i++)
                {
                    for (int j = 0; j < ck.Items.Count; j++)
                    {
                        if (ck.Items[j].Value == tt[i].ToString())
                        { ck.Items[j].Selected = true; break; }
                    }
                }
            }
            catch { }
            return ck;
        }
        #endregion

        #region 方法 SetDropDownListValue
        private void SetDropDownListValue(Anthem.DropDownList drpT, object o)
        {
            try
            {
                if ((TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit) || drpT.Items.FindByValue(o.ToString()) != null)
                {
                    drpT.SelectedValue = o.ToString();
                    return;
                }

                drpT.Items.Add(new ListItem(o.ToString(), o.ToString()));
                drpT.SelectedIndex = 0;

            }
            catch (Exception)
            {
            }
        }
        #endregion

        #region 重载 OnLoadComplete
        protected override void OnLoadComplete(EventArgs e)
        {
            if (!IsLoaded && TaskAPI.IsBeginStep && TaskAPI.IsAllowSubmit)
            {
                Actions_SelectedIndexChanged(null, e);
            }

            base.OnLoadComplete(e);
        }
        #endregion

        #region 表单中 Seach Term 1= Name1 ,Seach Term 2= BPCS Code
        protected void BA_Customer_Name_In_ZH_TextChanged(object sender, EventArgs e)
        {
            BA_Search_Term_1.Text = BA_Customer_Name_In_ZH.Text;
            BA_Acct_Holder.Text = BA_Customer_Name_In_ZH.Text;
        }



        protected void RE_BA_Customer_Name_In_ZH_TextChanged(object sender, EventArgs e)
        {
            RE_BA_Search_Term_1.Text = RE_BA_Customer_Name_In_ZH.Text;
            RE_BA_Acct_Holder.Text = RE_BA_Customer_Name_In_ZH.Text;
        }



        protected void BA_BPCS_Code_TextChanged(object sender, EventArgs e)
        {
            BA_Search_Term_2.Text = BA_BPCS_Code.Text;
            //BA_Bill_Search_Term2.Text = BA_BPCS_Code.Text;
            CO_BPCS.Text = BA_BPCS_Code.Text;
        }

        protected void ST_Ship_To_Name_TextChanged(object sender, EventArgs e)
        {
            ST_Search_Term1.Text = ST_Ship_To_Name.Text;
        }

        protected void RE_BA_BPCS_Code_TextChanged(object sender, EventArgs e)
        {
            RE_BA_Search_Term_2.Text = RE_BA_BPCS_Code.Text;
            RE_CO_BPCS.Text = RE_BA_BPCS_Code.Text;
        }

        protected void ST_Old_Ship_BPCS_TextChanged(object sender, EventArgs e)
        {
            ST_Search_Term2.Text = ST_Old_Ship_BPCS.Text;
        }


        protected void Internat_Name_TextChanged(object sender, EventArgs e)
        {
            Internat_Seach_Term.Text = Internat_Name.Text;
        }


        protected void BA_Bill_Name1_TextChanged(object sender, EventArgs e)
        {
            BA_Bill_Search_Term1.Text = BA_Bill_Name1.Text;
        }

        protected void BA_Indirect_Name1_TextChanged(object sender, EventArgs e)
        {
            BA_Indirect_Search_Term1.Text = BA_Indirect_Name1.Text;
        }

        protected void BA_Old_BPCS_Indirect_TextChanged(object sender, EventArgs e)
        {
            BA_Indirect_Search_Term2.Text = BA_Old_BPCS_Indirect.Text;
        }
        #endregion

        #region City Code带出County Code
        protected void BA_Bill_City_Code_SelectedIndexChanged(object sender, EventArgs e)
        {
            BA_Bill_County_Code.Text = "";
            IList<m_TW_City_Code> bh2 = (m_TW_City_Code.status == 1 & (m_TW_City_Code.city_Code == BA_Bill_City_Code.SelectedValue
             | m_TW_City_Code.city_Code == "")).List<m_TW_City_Code>();
            foreach (m_TW_City_Code BH in bh2)
            {

                BA_Bill_County_Code.Text = BH.County_Code;

            }
        }

        protected void BA_City_Code_SelectedIndexChanged(object sender, EventArgs e)
        {
            BA_County_Code.Text = "";
            IList<m_TW_City_Code> bh2 = (m_TW_City_Code.status == 1 & (m_TW_City_Code.city_Code == BA_City_Code.SelectedValue
             | m_TW_City_Code.city_Code == "")).List<m_TW_City_Code>();
            foreach (m_TW_City_Code BH in bh2)
            {

                BA_County_Code.Text = BH.County_Code;

            }
        }

        protected void ST_City_Code_SelectedIndexChanged(object sender, EventArgs e)
        {
            ST_County_Code.Text = "";
            IList<m_TW_City_Code> bh3 = (m_TW_City_Code.status == 1 & (m_TW_City_Code.city_Code == ST_City_Code.SelectedValue
             | m_TW_City_Code.city_Code == "")).List<m_TW_City_Code>();
            foreach (m_TW_City_Code BH in bh3)
            {

                ST_County_Code.Text = BH.County_Code;

            }
        }

        protected void RE_BA_City_Code_SelectedIndexChanged(object sender, EventArgs e)
        {
            RE_BA_County_Code.Text = "";
            IList<m_TW_City_Code> bh4 = (m_TW_City_Code.status == 1 & (m_TW_City_Code.city_Code == RE_BA_City_Code.SelectedValue
             | m_TW_City_Code.city_Code == "")).List<m_TW_City_Code>();
            foreach (m_TW_City_Code BH in bh4)
            {

                RE_BA_County_Code.Text = BH.County_Code;

            }
        }
        #endregion

        #region Terms of Payment= Payment Terms
        protected void CO_Payment_Terms_SelectedIndexChanged(object sender, EventArgs e)
        {
            SA_Terms_Of_Payment.Text = CO_Payment_Terms.Text;
        }

        protected void RE_CO_Payment_Terms_SelectedIndexChanged(object sender, EventArgs e)
        {
            RE_SA_Terms_Of_Payment.Text = RE_CO_Payment_Terms.Text;
        }
        #endregion

        #region sales person
        protected void BA_Sales_Employee_SelectedIndexChanged(object sender, EventArgs e)
        {
            SA_Sales_Code.Text = BA_Sales_Employee.Text;
        }


        protected void RE_BA_Sales_Employee_SelectedIndexChanged(object sender, EventArgs e)
        {
            RE_SA_Sales_Code.Text = RE_BA_Sales_Employee.Text;
        }
        #endregion

        #region Region
        protected void RE_BA_Region_SelectedIndexChanged(object sender, EventArgs e)
        {
            RE_Attributes9.Text = RE_BA_Region.Text;
        }

        protected void BA_Region_SelectedIndexChanged(object sender, EventArgs e)
        {
            Attributes9.Text = BA_Region.Text;
        }

        protected void ST_Region_SelectedIndexChanged(object sender, EventArgs e)
        {
            ST_Attributes9.Text = ST_Region.Text;
        }
        #endregion

        protected void SA_Customer_Division_K1_CheckedChanged(object sender, EventArgs e)
        {
            if (SA_Customer_Division_K1.Checked)
            {
                SetForeColor(Color.Blue, SA_Price_Group_1_L);
            }
            else
            {
                SetForeColor(Color.Black, SA_Price_Group_1_L);
            }
        }

        protected void SA_Customer_Division_K2_CheckedChanged(object sender, EventArgs e)
        {
            if (SA_Customer_Division_K2.Checked)
            {
                SetForeColor(Color.Blue, SA_Price_Group_2_L);
            }
            else
            {
                SetForeColor(Color.Black, SA_Price_Group_2_L);
            }
        }

        //protected void ST_Customer_Division_K1_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ST_Customer_Division_K1.Checked)
        //    {
        //        SetForeColor(Color.Blue, ST_Price_Group_1_L);
        //    }
        //    else
        //    {
        //        SetForeColor(Color.Black, ST_Price_Group_1_L);
        //    }
        //}

        //protected void ST_Customer_Division_K2_CheckedChanged(object sender, EventArgs e)
        //{
        //    if (ST_Customer_Division_K2.Checked)
        //    {
        //        SetForeColor(Color.Blue, ST_Price_Group_2_L);
        //    }
        //    else
        //    {
        //        SetForeColor(Color.Black, ST_Price_Group_2_L);
        //    }
        //}

        protected void RE_SA_Customer_Division_K1_CheckedChanged(object sender, EventArgs e)
        {
            if (RE_SA_Customer_Division_K1.Checked)
            {
                SetForeColor(Color.Blue, RE_SA_Price_Group_1_L);
            }
            else
            {
                SetForeColor(Color.Black, RE_SA_Price_Group_1_L);
            }
        }

        protected void RE_SA_Customer_Division_K2_CheckedChanged(object sender, EventArgs e)
        {
            if (RE_SA_Customer_Division_K2.Checked)
            {
                SetForeColor(Color.Blue, RE_SA_Price_Group_2_L);
            }
            else
            {
                SetForeColor(Color.Black, RE_SA_Price_Group_2_L);
            }
        }

        //protected void BA_Bazaar_Code_TextChanged(object sender, EventArgs e)
        //{
        //    Text_External.Text = BA_Bazaar_Code.Text;
        //}









    }
}